Policy assignments and information about each of its respective definitions
// Policy assignments and information about each of its respective definitions// Gets policy assignments in your environment with the respective assignment name,definition associated, category of definition (if applicable), as well as whether the definition type is an initiative or a single policy.policyResources|wheretype=~'Microsoft.Authorization/PolicyAssignments'|projectpolicyAssignmentId=tolower(tostring(id)),policyAssignmentDisplayName=tostring(properties.displayName),policyAssignmentDefinitionId=tolower(properties.policyDefinitionId)|joinkind=leftouter(policyResources|wheretype=~'Microsoft.Authorization/PolicySetDefinitions'ortype=~'Microsoft.Authorization/PolicyDefinitions'|projectdefinitionId=tolower(id),category=tostring(properties.metadata.category),definitionType=iff(type=~'Microsoft.Authorization/PolicysetDefinitions','initiative','policy'))on$left.policyAssignmentDefinitionId==$right.definitionId
Policy assignments and information about each of its respective definitions displaying the scope of the assignment, the subscription display name, the management group id, the resource group name, the definition type, the assignment name, the category of the definition, and the policy assignment ID.