Any can update and guide me on this
Export the data of Policy Assignments Name, Type (Intiatives or Policy), Scope and then for each Policy Assignments I need the policy definitions Version, category, type associated with it and export in excel file
Hello Team,
Can any one help on how I can Export the data of Policy Assignments Name, Type (Intiatives or Policy), Scope and then for each Policy Assignments I need the policy definitions Version, category, type associated with it and export in excel file.
Any KQL Query or Powershell script that helps.
Thank YOU...
2 answers
Sort by: Most helpful
-
-
Prashant Kumar 775 Reputation points Microsoft Employee
2024-09-04T06:40:33.0966667+00:00 Hi J.I PRASHANDH
You can use policyresources table in Azure Resource graph to get policy assignments, definitions and setdefinitions(initiative) details.
You will get most of your fields from policyassignments type but to get more information about related policy definitions or setdefinitions, you will have to use join between these three types.
Sample ARG query:
policyresources | where type == "microsoft.authorization/policyassignments" | project id,name,subscriptionId,policyDefinitionId =(properties.policyDefinitionId),scope = (properties.scope),definitionVersion=(properties.definitionVersion)