diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..19fdfe3892a1
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,35 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyEvents)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "NumDenyEvents": {
+ "ordinal": 1,
+ "name": "NumDenyEvents",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ 40
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..0f6f72e9a190
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,67 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumEvents))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 4,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "NumEvents": {
+ "ordinal": 5,
+ "name": "NumEvents",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "audit",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ 1
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "audit",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ 1
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..b26724d30dde
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,60 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 4,
+ "name": "ResourceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/storageaccountsku",
+ "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ "deny",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/mysa1"
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ "deny",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.storage/storageaccounts/mysa2"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..fa7245208b18
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,74 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-01-01T00:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, ResourceId))/groupby((PolicyAssignmentId, PolicyDefinitionId), aggregate($count as NumDeniedResources))",
+ "$orderby": "NumDeniedResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "NumDeniedResources": {
+ "ordinal": 3,
+ "name": "NumDeniedResources",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/0591f497c35344fcbaf7a393",
+ "/providers/microsoft.authorization/policydefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
+ 3
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/mypolicyassignment2",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition2",
+ 2
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/mypolicyassignment2",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition3",
+ 2
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/mypolicyassignment3",
+ "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ 1
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ 1
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/mypolicyassignment1",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition1",
+ 1
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..b1f067647e55
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,218 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff5d536aec743a0aa801c1a",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff5d536aec743a0aa801c1a",
+ "tbd",
+ "{}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ "fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff21232277412542086",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ],
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff16fce53454b15a7ed803d",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fff0414b-fff4-fffd-fff5-fff79a89232c",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff16fce53454b15a7ed803d",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fff0414b-fff4-fffd-fff5-fff79a89232c",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..108398679652
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,217 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T23:24:28.4444412Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/fffc58b7db524a9799381531",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/fff79b49-fff9-fff5-fffe-fff49ab8b474",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ServiceFabric/clusters/applications",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "fffc58b7db524a9799381531",
+ "tbd",
+ "{\"TAGNAME_1\":{\"value\":\"NA\"}}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fff79b49-fff9-fff5-fffe-fff49ab8b474",
+ "audit",
+ "tbd",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/fff58873-fff8-fff5-fffc-fffbe7c9d697",
+ "fff58873-fff8-fff5-fffc-fffbe7c9d697",
+ null,
+ null,
+ null,
+ "",
+ "2124621540977569058",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff3809a-fffc-fffe-fff1-fffe57573195"
+ ],
+ [
+ "2018-02-05T23:24:28.4444412Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ServiceFabric/clusters/applications",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "fff044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff3809a-fffc-fffe-fff1-fffe57573195"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..de3ef8f85c41
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,218 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff5d536aec743a0aa801c1a",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff5d536aec743a0aa801c1a",
+ "tbd",
+ "{}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ "fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff21232277412542086",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ],
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff16fce53454b15a7ed803d",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fff0414b-fff4-fffd-fff5-fff79a89232c",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff16fce53454b15a7ed803d",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fff0414b-fff4-fffd-fff5-fff79a89232c",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..4b2a308e07fc
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QueryResourceScope.json
@@ -0,0 +1,217 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:34:02.3475017Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/fff27f38-fff4-fff8-fff1-fffc84b8c017",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ClassicCompute/domainNames",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "fff27f38-fff4-fff8-fff1-fffc84b8c017",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Authorization/policySetDefinitions/fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ "fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ null,
+ null,
+ null,
+ "",
+ null,
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ ],
+ [
+ "2018-02-05T22:34:01.6135357Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ClassicCompute/domainNames",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "Enable Monitoring in Azure Security Center",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Authorization/policySetDefinitions/fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ "fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ null,
+ null,
+ null,
+ "",
+ null,
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..2afdac243708
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,217 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T23:24:28.4444412Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/fffc58b7db524a9799381531",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/fff79b49-fff9-fff5-fffe-fff49ab8b474",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "fffc58b7db524a9799381531",
+ "tbd",
+ "{\"TAGNAME_1\":{\"value\":\"NA\"}}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fff79b49-fff9-fff5-fffe-fff49ab8b474",
+ "audit",
+ "tbd",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/fff58873-fff8-fff5-fffc-fffbe7c9d697",
+ "fff58873-fff8-fff5-fffc-fffbe7c9d697",
+ null,
+ null,
+ null,
+ "",
+ "2124621540977569058",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff3809a-fffc-fffe-fff1-fffe57573195"
+ ],
+ [
+ "2018-02-05T23:24:28.4444412Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "fff044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff3809a-fffc-fffe-fff1-fffe57573195"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..db6d9b7e4766
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,217 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:34:02.3475017Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/fff27f38-fff4-fff8-fff1-fffc84b8c017",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "fff27f38-fff4-fff8-fff1-fffc84b8c017",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Authorization/policySetDefinitions/fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ "fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ null,
+ null,
+ null,
+ "",
+ null,
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ ],
+ [
+ "2018-02-05T22:34:01.6135357Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "Enable Monitoring in Azure Security Center",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Authorization/policySetDefinitions/fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ "fffafdf9-fff9-fffd-ffff-fffa613e70a8",
+ null,
+ null,
+ null,
+ "",
+ null,
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..1391d87459ed
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,217 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "TenantId": {
+ "ordinal": 26,
+ "name": "TenantId",
+ "dataType": "String"
+ },
+ "PrincipalOid": {
+ "ordinal": 27,
+ "name": "PrincipalOid",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff5d536aec743a0aa801c1a",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff5d536aec743a0aa801c1a",
+ "tbd",
+ "{}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fffd9357-fff0-fff7-fff4-fff30ce4c32d",
+ "audit",
+ "tbd",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ "fffcefd2-fff6-ffff-fff4-fffa170eb1d5",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "fff21232277412542086",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ],
+ [
+ "2018-02-05T22:54:39.8128521Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/fff16fce53454b15a7ed803d",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/fff0414b-fff4-fffd-fff5-fff79a89232c",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.OperationalInsights/workspaces",
+ "canadacentral",
+ "myResourceGroup",
+ "tbd",
+ "fff16fce53454b15a7ed803d",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "fff0414b-fff4-fffd-fff5-fff79a89232c",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "",
+ "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "ffffb743-fff5-fff7-fffe-fffc2444f333"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..a92381298268
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 2,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "SubscriptionId": {
+ "ordinal": 4,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 5,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 6,
+ "name": "ResourceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-05T22:34:02.3475017Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/fff27f38-fff4-fff8-fff1-fffc84b8c017",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "myResourceGroup",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"
+ ],
+ [
+ "2018-02-05T22:34:01.6135357Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "/providers/Microsoft.Authorization/policyDefinitions/fffea587-fff0-fff3-ffff-fff0ae01cfd6",
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "myResourceGroup",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/policyEvents.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/policyEvents.json
new file mode 100644
index 000000000000..c210b4653b4d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/policyEvents.json
@@ -0,0 +1,613 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyEventsClient",
+ "version": "2017-08-09-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForManagementGroup",
+ "description": "Queries policy events for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForSubscription",
+ "description": "Queries policy events for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResourceGroup",
+ "description": "Queries policy events for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResource",
+ "description": "Queries policy events for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyEventsQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyEventsQueryResultsTable"
+ }
+ }
+ }
+ },
+ "PolicyEventsQueryResultsTable": {
+ "description": "Query results table.",
+ "properties": {
+ "metadata": {
+ "description": "Metadata about the query results.",
+ "properties": {
+ "generatedQuery": {
+ "description": "Internal query generated. Used for diagnostics purposes.",
+ "type": "string"
+ }
+ }
+ },
+ "columns": {
+ "type": "object",
+ "description": "List of columns included in query results.",
+ "properties": {
+ "Timestamp": {
+ "description": "Timestamp for the policy event record.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceId": {
+ "description": "Resource ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionId": {
+ "description": "Policy definition ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "EffectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "$ref": "#/definitions/Column"
+ },
+ "IsCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "$ref": "#/definitions/Column"
+ },
+ "SubscriptionId": {
+ "description": "Subscription ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceType": {
+ "description": "Resource type.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceLocation": {
+ "description": "Resource location.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceGroup": {
+ "description": "Resource group name.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceTags": {
+ "description": "List of resource tags.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentName": {
+ "description": "Policy assignment name.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionName": {
+ "description": "Policy definition name.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "ManagementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "TenantId": {
+ "description": "Tenant ID for the policy event record.",
+ "$ref": "#/definitions/Column"
+ },
+ "PrincipalOid": {
+ "description": "Principal object ID for the user who initiated the resource operation that triggered the policy event.",
+ "$ref": "#/definitions/Column"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "rows": {
+ "description": "Query result rows, each representing a policy event record.",
+ "type": "array",
+ "items": {
+ "description": "Query result row.",
+ "type": "array",
+ "items": {
+ "description": "Each column of the query result row."
+ }
+ }
+ }
+ }
+ },
+ "Column": {
+ "description": "Column definition.",
+ "properties": {
+ "ordinal": {
+ "description": "Ordinal value of the column in a record.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "name": {
+ "description": "Name of the column.",
+ "type": "string"
+ },
+ "dataType": {
+ "description": "Data type of the column.",
+ "type": "string"
+ }
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": {
+ "policyEventsResourceParameter": {
+ "name": "policyEventsResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default"
+ ],
+ "description": "The name of the virtual resource under PolicyEvents resource type; only \"default\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management resource provider; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..0ca1a4b02617
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,25 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyEvents)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "NumDenyEvents": 40
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..77d555367519
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,39 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumEvents))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ "NumEvents": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ "NumEvents": 1
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..3d88615e5f30
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,37 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ "policyDefinitionAction": "deny",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.storage/storageaccounts/7d528d3a"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ "policyDefinitionAction": "deny",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/mysa1"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..a4d6f148c8f3
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,64 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-01-01T00:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, ResourceId))/groupby((PolicyAssignmentId, PolicyDefinitionId), aggregate($count as NumDeniedResources))",
+ "$orderby": "NumDeniedResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 6,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/0591f497c35344fcbaf7a393",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
+ "NumDeniedResources": 3
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition1",
+ "NumDeniedResources": 2
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition2",
+ "NumDeniedResources": 2
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ "NumDeniedResources": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ "NumDeniedResources": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/myassignment2",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition3",
+ "NumDeniedResources": 1
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/GetMetadata.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/GetMetadata.json
new file mode 100644
index 000000000000..46af2d35d0da
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/GetMetadata.json
@@ -0,0 +1,14 @@
+{
+ "parameters": {
+ "scope": "subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "headers": {
+ "content-type": "application/xml"
+ },
+ "body": " Org.OData.Capabilities.V1.ConformanceLevelType/Minimal application/json;odata.metadata=minimal;IEEE754Compatible=false;odata.streaming=true application/json;odata.metadata=none;IEEE754Compatible=false;odata.streaming=true "
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..0d6f25644a88
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,80 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T22:19:18.8896095Z",
+ "resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
+ "resourceType": "/Microsoft.Compute/virtualMachines/extensions",
+ "resourceLocation": "westeurope",
+ "resourceGroup": "myrg",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "1ef5d536aec743a0aa801c1a",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "15521232277412542086",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T22:19:18.8896095Z",
+ "resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/95816fce53454b15a7ed803d",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/a2c0414b-82e4-459d-97d5-94c79a89232c",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
+ "resourceType": "/Microsoft.Compute/virtualMachines/extensions",
+ "resourceLocation": "westeurope",
+ "resourceGroup": "myrg",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "95816fce53454b15a7ed803d",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "a2c0414b-82e4-459d-97d5-94c79a89232c",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "",
+ "policySetDefinitionName": "",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..aafd6dee8bc2
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..86ca4e519e5a
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,80 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..78bee2e47c43
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QueryResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.8473851Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.5842458Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..dc3723aff046
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..08c4d91c6f27
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.8473851Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.5842458Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..20ad429a16c3
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..761a5f9ec917
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,42 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-05T22:34:02.3475017Z",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/89b27f38-e9e4-4468-ab81-801c84b8c017",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myResourceGroup",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomain"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-05T22:34:01.6135357Z",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myResourceGroup",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomain"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/policyEvents.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/policyEvents.json
new file mode 100644
index 000000000000..92ae30f6b40b
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/policyEvents.json
@@ -0,0 +1,636 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyEventsClient",
+ "version": "2017-10-17-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForManagementGroup",
+ "description": "Queries policy events for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForSubscription",
+ "description": "Queries policy events for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResourceGroup",
+ "description": "Queries policy events for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResource",
+ "description": "Queries policy events for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ },
+ "/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata": {
+ "get": {
+ "operationId": "PolicyEvents_GetMetadata",
+ "description": "Gets OData metadata XML document.",
+ "produces": [
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/parameters/scopeParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OData metadata XML document.",
+ "schema": {
+ "$ref": "#/definitions/MetadataDocument"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Get metadata": { "$ref": "./examples/GetMetadata.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyEventsQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "@odata.count": {
+ "description": "OData entity count; represents the number of policy event records returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyEvent"
+ }
+ }
+ }
+ },
+ "PolicyEvent": {
+ "type": "object",
+ "description": "Policy event record.",
+ "properties": {
+ "@odata.id": {
+ "description": "OData entity ID; always set to null since policy event records do not have an entity ID.",
+ "type": "string"
+ },
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "Timestamp for the policy event record.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "resourceId": {
+ "description": "Resource ID.",
+ "type": "string"
+ },
+ "policyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "type": "string"
+ },
+ "policyDefinitionId": {
+ "description": "Policy definition ID.",
+ "type": "string"
+ },
+ "effectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "type": "string"
+ },
+ "isCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "type": "boolean"
+ },
+ "subscriptionId": {
+ "description": "Subscription ID.",
+ "type": "string"
+ },
+ "resourceType": {
+ "description": "Resource type.",
+ "type": "string"
+ },
+ "resourceLocation": {
+ "description": "Resource location.",
+ "type": "string"
+ },
+ "resourceGroup": {
+ "description": "Resource group name.",
+ "type": "string"
+ },
+ "resourceTags": {
+ "description": "List of resource tags.",
+ "type": "string"
+ },
+ "policyAssignmentName": {
+ "description": "Policy assignment name.",
+ "type": "string"
+ },
+ "policyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "type": "string"
+ },
+ "policyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "type": "string"
+ },
+ "policyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "type": "string"
+ },
+ "policyDefinitionName": {
+ "description": "Policy definition name.",
+ "type": "string"
+ },
+ "policyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "type": "string"
+ },
+ "policyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "type": "string"
+ },
+ "policySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "managementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "type": "string"
+ },
+ "policyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "tenantId": {
+ "description": "Tenant ID for the policy event record.",
+ "type": "string"
+ },
+ "principalOid": {
+ "description": "Principal object ID for the user who initiated the resource operation that triggered the policy event.",
+ "type": "string"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "MetadataDocument": {
+ "description": "Metadata XML document.",
+ "type": "string"
+ }
+ },
+ "parameters": {
+ "policyEventsResourceParameter": {
+ "name": "policyEventsResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default"
+ ],
+ "description": "The name of the virtual resource under PolicyEvents resource type; only \"default\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management resource provider; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "scopeParameter": {
+ "name": "scope",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..a3062e9db16e
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,25 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyEvents)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "NumDenyEvents": 40
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..022ab140f937
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,39 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumEvents))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ "NumEvents": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
+ "NumEvents": 1
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..ba318c2e7c0a
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,37 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ "policyDefinitionAction": "deny",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.storage/storageaccounts/7d528d3a"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ "policyDefinitionAction": "deny",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/mysa1"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..8c838724c7a9
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,64 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-01-01T00:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, ResourceId))/groupby((PolicyAssignmentId, PolicyDefinitionId), aggregate($count as NumDeniedResources))",
+ "$orderby": "NumDeniedResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 6,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/0591f497c35344fcbaf7a393",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
+ "NumDeniedResources": 3
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition1",
+ "NumDeniedResources": 2
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition2",
+ "NumDeniedResources": 2
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
+ "NumDeniedResources": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
+ "NumDeniedResources": 1
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/myassignment2",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition3",
+ "NumDeniedResources": 1
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/GetMetadata.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/GetMetadata.json
new file mode 100644
index 000000000000..4fd89e615525
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/GetMetadata.json
@@ -0,0 +1,14 @@
+{
+ "parameters": {
+ "scope": "subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "headers": {
+ "content-type": "application/xml"
+ },
+ "body": " Org.OData.Capabilities.V1.ConformanceLevelType/Minimal application/json;odata.metadata=minimal;IEEE754Compatible=false;odata.streaming=true application/json;odata.metadata=none;IEEE754Compatible=false;odata.streaming=true "
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..f8bb22eaf682
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,80 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T22:19:18.8896095Z",
+ "resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
+ "resourceType": "/Microsoft.Compute/virtualMachines/extensions",
+ "resourceLocation": "westeurope",
+ "resourceGroup": "myrg",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "1ef5d536aec743a0aa801c1a",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "15521232277412542086",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T22:19:18.8896095Z",
+ "resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/95816fce53454b15a7ed803d",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/a2c0414b-82e4-459d-97d5-94c79a89232c",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
+ "resourceType": "/Microsoft.Compute/virtualMachines/extensions",
+ "resourceLocation": "westeurope",
+ "resourceGroup": "myrg",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "95816fce53454b15a7ed803d",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "a2c0414b-82e4-459d-97d5-94c79a89232c",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "",
+ "policySetDefinitionName": "",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..402bddb8261c
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..8d2fa1415698
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json
@@ -0,0 +1,82 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "myPolicyAssignment",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T00:07:16.2804863Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/defaultworkspace-fffedd8f-ffff-fffd-fffd-fffed2f84852-eus",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyDefinitions/myPolicyDefinition",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.operationalinsights/workspaces",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "myPolicyAssignment",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": null,
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup",
+ "policyDefinitionName": "myPolicyAssignment",
+ "policyDefinitionAction": "deny",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff2f355-fff2-fffc-fffb-fff1639dff94"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T00:06:08.4302267Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/defaultworkspace-fffedd8f-ffff-fffd-fffd-fffed2f84852-eus",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyDefinitions/myPolicyDefinition",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.operationalinsights/workspaces",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "myPolicyAssignment",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": null,
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup",
+ "policyDefinitionName": "myPolicyAssignment",
+ "policyDefinitionAction": "deny",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff2f355-fff2-fffc-fffb-fff1639dff94"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..2d88893fb7fc
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,80 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..373699893a2d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QueryResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.8473851Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.5842458Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..c052cf688275
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..f9e2e62aed51
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json
@@ -0,0 +1,81 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:59:38.6401747Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:59:34.2017762Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json
new file mode 100644
index 000000000000..c6c7aa9644c2
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json
@@ -0,0 +1,81 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:58:11.590596Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/deploymentSlots/production/state/start",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/f4cc58b7db524a9799381531",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames/deploymentSlots/state",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "f4cc58b7db524a9799381531",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"NA\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "14799174781370023846",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:58:11.590596Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/deploymentSlots/production/state/start",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/f4cc58b7db524a9799381531",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames/deploymentSlots/state",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "f4cc58b7db524a9799381531",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"NA\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "1679708035638239273",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json
new file mode 100644
index 000000000000..26b417ffb39e
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json
@@ -0,0 +1,81 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:49:32.9539023Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/serviceCertificates/sha1-FFFBDAF1FFFF109FFFD95FFFC9B0FFFD6F264FFF",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames/serviceCertificates",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-08T19:49:32.9498186Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/serviceCertificates/sha1-FFF36C1CFFF4BEA57FFFEFCFFF17B9F81B710FFF",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames/serviceCertificates",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..ab03f9b6dbcb
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.8473851Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T15:14:39.5842458Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null,
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fff890fa-fff0-fff3-fff9-fffd7653f078"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..f086b99c01e0
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,79 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "181565554491747128",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-07T20:43:04.6971328Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/ec62f9b2a454487296f2ccd4",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec62f9b2a454487296f2ccd4",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"ALLOWEDRESOURCEGROUPS_1\":{\"value\":[\"rg1\",\"rg2\"]},\"ALLOWEDRESOURCEGROUPS_2\":{\"value\":[\"myrg3\",\"myrg4\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionName": "00b36c66-612b-44e2-9f8e-b758296d40fe",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "624540685646900425",
+ "tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "principalOid": "fffdfc0f-fff5-fff0-fff3-fff1a968dcc6"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..f29e6fe38555
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,42 @@
+{
+ "parameters": {
+ "policyEventsResource": "default",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-05T22:34:02.3475017Z",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/89b27f38-e9e4-4468-ab81-801c84b8c017",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myResourceGroup",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomain"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
+ "timestamp": "2018-02-05T22:34:01.6135357Z",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/201ea587-7c90-41c3-910f-c280ae01cfd6",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myResourceGroup",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomain"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/policyEvents.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/policyEvents.json
new file mode 100644
index 000000000000..0de99f15635e
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/policyEvents.json
@@ -0,0 +1,918 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyEventsClient",
+ "version": "2017-12-12-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForManagementGroup",
+ "description": "Queries policy events for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForSubscription",
+ "description": "Queries policy events for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResourceGroup",
+ "description": "Queries policy events for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResource",
+ "description": "Queries policy events for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForPolicySetDefinition",
+ "description": "Queries policy events for the subscription level policy set definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policySetDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription level policy set definition scope": { "$ref": "./examples/QuerySubscriptionLevelPolicySetDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForPolicyDefinition",
+ "description": "Queries policy events for the subscription level policy definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription level policy definition scope": { "$ref": "./examples/QuerySubscriptionLevelPolicyDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForSubscriptionLevelPolicyAssignment",
+ "description": "Queries policy events for the subscription level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at subscription level policy assignment scope": { "$ref": "./examples/QuerySubscriptionLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyEvents_ListQueryResultsForResourceGroupLevelPolicyAssignment",
+ "description": "Queries policy events for the resource group level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyEventsResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyEventsQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query at resource group level policy assignment scope": { "$ref": "./examples/QueryResourceGroupLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata": {
+ "get": {
+ "operationId": "PolicyEvents_GetMetadata",
+ "description": "Gets OData metadata XML document.",
+ "produces": [
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/parameters/scopeParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OData metadata XML document.",
+ "schema": {
+ "$ref": "#/definitions/MetadataDocument"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Get metadata": { "$ref": "./examples/GetMetadata.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyEventsQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "@odata.count": {
+ "description": "OData entity count; represents the number of policy event records returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyEvent"
+ }
+ }
+ }
+ },
+ "PolicyEvent": {
+ "type": "object",
+ "description": "Policy event record.",
+ "properties": {
+ "@odata.id": {
+ "description": "OData entity ID; always set to null since policy event records do not have an entity ID.",
+ "type": "string"
+ },
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "Timestamp for the policy event record.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "resourceId": {
+ "description": "Resource ID.",
+ "type": "string"
+ },
+ "policyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "type": "string"
+ },
+ "policyDefinitionId": {
+ "description": "Policy definition ID.",
+ "type": "string"
+ },
+ "effectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "type": "string"
+ },
+ "isCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "type": "boolean"
+ },
+ "subscriptionId": {
+ "description": "Subscription ID.",
+ "type": "string"
+ },
+ "resourceType": {
+ "description": "Resource type.",
+ "type": "string"
+ },
+ "resourceLocation": {
+ "description": "Resource location.",
+ "type": "string"
+ },
+ "resourceGroup": {
+ "description": "Resource group name.",
+ "type": "string"
+ },
+ "resourceTags": {
+ "description": "List of resource tags.",
+ "type": "string"
+ },
+ "policyAssignmentName": {
+ "description": "Policy assignment name.",
+ "type": "string"
+ },
+ "policyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "type": "string"
+ },
+ "policyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "type": "string"
+ },
+ "policyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "type": "string"
+ },
+ "policyDefinitionName": {
+ "description": "Policy definition name.",
+ "type": "string"
+ },
+ "policyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "type": "string"
+ },
+ "policyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "type": "string"
+ },
+ "policySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "managementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "type": "string"
+ },
+ "policyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "tenantId": {
+ "description": "Tenant ID for the policy event record.",
+ "type": "string"
+ },
+ "principalOid": {
+ "description": "Principal object ID for the user who initiated the resource operation that triggered the policy event.",
+ "type": "string"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "MetadataDocument": {
+ "description": "Metadata XML document.",
+ "type": "string"
+ }
+ },
+ "parameters": {
+ "policyEventsResourceParameter": {
+ "name": "policyEventsResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default"
+ ],
+ "description": "The name of the virtual resource under PolicyEvents resource type; only \"default\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management RP; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "authorizationNamespaceParameter": {
+ "name": "authorizationNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Authorization"
+ ],
+ "description": "The namespace for Microsoft Authorization resource provider; only \"Microsoft.Authorization\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "policySetDefinitionNameParameter": {
+ "name": "policySetDefinitionName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy set definition name.",
+ "x-ms-parameter-location": "method"
+ },
+ "policyDefinitionNameParameter": {
+ "name": "policyDefinitionName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy definition name.",
+ "x-ms-parameter-location": "method"
+ },
+ "policyAssignmentNameParameter": {
+ "name": "policyAssignmentName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy assignment name.",
+ "x-ms-parameter-location": "method"
+ },
+ "scopeParameter": {
+ "name": "scope",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..ba77d538455c
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,35 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyStates)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "NumDenyStates": {
+ "ordinal": 1,
+ "name": "NumDenyStates",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ 12
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..08ad43bf0cd9
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,68 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))",
+ "$orderby": "NumAuditDenyNonComplianceRecords desc",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 4,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "NumAuditDenyNonComplianceRecords": {
+ "ordinal": 5,
+ "name": "NumAuditDenyNonComplianceRecords",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "audit",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.classiccompute/domainnames/myDomainName",
+ 8
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "audit",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.classiccompute/domainnames/myDomainName",
+ 8
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..20c1afea661d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,60 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 4,
+ "name": "ResourceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "auditifnotexists",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.network/virtualnetworks/vnet"
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d15545b8-ff50-409a-a6e3-5bd5cc954003",
+ "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "auditifnotexists",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.network/virtualnetworks/vnet"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..637bee4487e5
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,123 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$filter": "IsCompliant eq false",
+ "$apply": "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))",
+ "$orderby": "NumNonCompliantResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "PolicyAssignmentId": {
+ "ordinal": 1,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 2,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ },
+ "NumNonCompliantResources": {
+ "ordinal": 5,
+ "name": "NumNonCompliantResources",
+ "dataType": "Numeric"
+ }
+ },
+ "rows": [
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "1679708035638239273",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "14799174781370023846",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "1679708035638239273",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49",
+ "",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "14799174781370023846",
+ 557
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "",
+ 552
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "8935913113203900114",
+ 544
+ ],
+ [
+ "/providers/microsoft.management/managementgroups/azgovtest1/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874",
+ "",
+ "/providers/microsoft.management/managementgroups/azgovtest1/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "",
+ 526
+ ],
+ [
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "2124621540977569058",
+ 509
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/ListOperations.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/ListOperations.json
new file mode 100644
index 000000000000..d5a2b53cb332
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/ListOperations.json
@@ -0,0 +1,40 @@
+{
+ "parameters": {
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Events",
+ "operation": "Query Policy Events",
+ "description": "Query information about policy events."
+ }
+ },
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy States",
+ "operation": "Query Policy States",
+ "description": "Query information about policy states."
+ }
+ },
+ {
+ "name": "latest/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Latest States",
+ "operation": "Query Policy Latest States",
+ "description": "Query information about policy latest states."
+ }
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..b8fd01144798
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,204 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T23:19:37Z",
+ "/subscriptions/fff83be3-fff8-fff8-fff5-fff2625f5bb5/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myResourceGroup-vnet",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/8174043a1e2849179635b874",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ null,
+ false,
+ "fff83be3-fff8-fff8-fff5-fff2625f5bb5",
+ "/Microsoft.Network/virtualNetworks",
+ "westcentralus",
+ "myResourceGroup",
+ "tbd",
+ "8174043a1e2849179635b874",
+ "tbd",
+ "{\"allowedResourceGroups\":{\"value\":[\"value1\",\"value2\",\"value3\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T23:19:37Z",
+ "/subscriptions/fff83be3-fff8-fff8-fff5-fff2625f5bb5/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myResourceGroup-vnet",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/95816fce53454b15a7ed803d",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/a2c0414b-82e4-459d-97d5-94c79a89232c",
+ null,
+ false,
+ "fff83be3-fff8-fff8-fff5-fff2625f5bb5",
+ "/Microsoft.Network/virtualNetworks",
+ "westcentralus",
+ "myResourceGroup",
+ "tbd",
+ "95816fce53454b15a7ed803d",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "a2c0414b-82e4-459d-97d5-94c79a89232c",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..472b013ee782
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,203 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d6be6bb37e5f4333baa95c2a",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ServiceFabric/clusters/applications",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "d6be6bb37e5f4333baa95c2a",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ServiceFabric/clusters/applications",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "3f3c4330183b4e218fe6fd29",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "24813039-7534-408a-9842-eb99f45721b1",
+ "audit",
+ "tbd",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..db139dfd14f8
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,204 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-09T00:06:00Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/serviceCertificates/sha1-FFFBDAF1F25210FFFDD95BD0C9B0AFCD6F26FFFF",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.ClassicCompute/domainNames/serviceCertificates",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/mymg",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-09T00:06:00Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.ClassicCompute/domainNames",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/mymg",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..8271ca16056d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QueryResourceScope.json
@@ -0,0 +1,203 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ClassicCompute/domainNames",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/mymg",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.ClassicCompute/domainNames",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "test",
+ "tbd",
+ "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "Audit a tag and it's value",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..e2a800113ec3
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,203 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d6be6bb37e5f4333baa95c2a",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "d6be6bb37e5f4333baa95c2a",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "audit",
+ "tbd",
+ "",
+ "",
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "3f3c4330183b4e218fe6fd29",
+ "tbd",
+ "{}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "24813039-7534-408a-9842-eb99f45721b1",
+ "audit",
+ "tbd",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..78f90110965d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,203 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/mymg",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T07:04:29Z",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ null,
+ false,
+ "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "/Microsoft.SomeNamespace/someResourceType",
+ "eastus",
+ "",
+ "tbd",
+ "test",
+ "tbd",
+ "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "Audit a tag and it's value",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..d2c4bc025675
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,203 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "ResourceId": {
+ "ordinal": 2,
+ "name": "ResourceId",
+ "dataType": "String"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 3,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 4,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "EffectiveParameters": {
+ "ordinal": 5,
+ "name": "EffectiveParameters",
+ "dataType": "String"
+ },
+ "IsCompliant": {
+ "ordinal": 6,
+ "name": "IsCompliant",
+ "dataType": "Boolean"
+ },
+ "SubscriptionId": {
+ "ordinal": 7,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceType": {
+ "ordinal": 8,
+ "name": "ResourceType",
+ "dataType": "String"
+ },
+ "ResourceLocation": {
+ "ordinal": 9,
+ "name": "ResourceLocation",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 10,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceTags": {
+ "ordinal": 11,
+ "name": "ResourceTags",
+ "dataType": "String"
+ },
+ "PolicyAssignmentName": {
+ "ordinal": 12,
+ "name": "PolicyAssignmentName",
+ "dataType": "String"
+ },
+ "PolicyAssignmentOwner": {
+ "ordinal": 13,
+ "name": "PolicyAssignmentOwner",
+ "dataType": "String"
+ },
+ "PolicyAssignmentParameters": {
+ "ordinal": 14,
+ "name": "PolicyAssignmentParameters",
+ "dataType": "String"
+ },
+ "PolicyAssignmentScope": {
+ "ordinal": 15,
+ "name": "PolicyAssignmentScope",
+ "dataType": "String"
+ },
+ "PolicyDefinitionName": {
+ "ordinal": 16,
+ "name": "PolicyDefinitionName",
+ "dataType": "String"
+ },
+ "PolicyDefinitionAction": {
+ "ordinal": 17,
+ "name": "PolicyDefinitionAction",
+ "dataType": "String"
+ },
+ "PolicyDefinitionCategory": {
+ "ordinal": 18,
+ "name": "PolicyDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionId": {
+ "ordinal": 19,
+ "name": "PolicySetDefinitionId",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionName": {
+ "ordinal": 20,
+ "name": "PolicySetDefinitionName",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionOwner": {
+ "ordinal": 21,
+ "name": "PolicySetDefinitionOwner",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionCategory": {
+ "ordinal": 22,
+ "name": "PolicySetDefinitionCategory",
+ "dataType": "String"
+ },
+ "PolicySetDefinitionParameters": {
+ "ordinal": 23,
+ "name": "PolicySetDefinitionParameters",
+ "dataType": "String"
+ },
+ "ManagementGroupIds": {
+ "ordinal": 24,
+ "name": "ManagementGroupIds",
+ "dataType": "String"
+ },
+ "PolicyDefinitionReferenceId": {
+ "ordinal": 25,
+ "name": "PolicyDefinitionReferenceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-08T23:26:49Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.ServiceFabric/clusters/applications/services",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ],
+ [
+ "2018-02-08T23:26:49Z",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ null,
+ false,
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "/Microsoft.ServiceFabric/clusters/applications",
+ "eastus",
+ "myResourceGroup",
+ "tbd",
+ "186044306c044a1d8c0ff76c",
+ "tbd",
+ "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "audit",
+ "tbd",
+ null,
+ null,
+ null,
+ null,
+ null,
+ "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ null
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..14ebadc58bf9
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-08-09-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "metadata": {
+ "generatedQuery": ""
+ },
+ "columns": {
+ "Timestamp": {
+ "ordinal": 1,
+ "name": "Timestamp",
+ "dataType": "DateTime"
+ },
+ "PolicyAssignmentId": {
+ "ordinal": 2,
+ "name": "PolicyAssignmentId",
+ "dataType": "String"
+ },
+ "PolicyDefinitionId": {
+ "ordinal": 3,
+ "name": "PolicyDefinitionId",
+ "dataType": "String"
+ },
+ "SubscriptionId": {
+ "ordinal": 4,
+ "name": "SubscriptionId",
+ "dataType": "String"
+ },
+ "ResourceGroup": {
+ "ordinal": 5,
+ "name": "ResourceGroup",
+ "dataType": "String"
+ },
+ "ResourceId": {
+ "ordinal": 6,
+ "name": "ResourceId",
+ "dataType": "String"
+ }
+ },
+ "rows": [
+ [
+ "2018-02-06T17:58:00Z",
+ "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "myResourceGroup1",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup1/providers/Microsoft.Storage/storageAccounts/mysa1"
+ ],
+ [
+ "2018-02-06T17:58:00Z",
+ "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "myResourceGroup2",
+ "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup2/providers/Microsoft.Storage/storageAccounts/mysa2"
+ ]
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/policyStates.json
new file mode 100644
index 000000000000..d59ae97be095
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/policyStates.json
@@ -0,0 +1,680 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyStatesClient",
+ "version": "2017-08-09-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForManagementGroup",
+ "description": "Queries policy states for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForSubscription",
+ "description": "Queries policy states for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResourceGroup",
+ "description": "Queries policy states for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResource",
+ "description": "Queries policy states for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query all policy states at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query all policy states at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query all policy states at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query all policy states at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ },
+ "/providers/Microsoft.PolicyInsights/operations": {
+ "get": {
+ "operationId": "PolicyInsights_ListOperations",
+ "description": "Lists available operations.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "List of available operations.",
+ "schema": {
+ "$ref": "#/definitions/Operations"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "List operations": { "$ref": "./examples/ListOperations.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyStatesQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyStatesQueryResultsTable"
+ }
+ }
+ }
+ },
+ "PolicyStatesQueryResultsTable": {
+ "description": "Query results table.",
+ "properties": {
+ "metadata": {
+ "description": "Metadata about the query results.",
+ "properties": {
+ "generatedQuery": {
+ "description": "Internal query generated. Used for diagnostics purposes.",
+ "type": "string"
+ }
+ }
+ },
+ "columns": {
+ "type": "object",
+ "description": "List of columns included in query results.",
+ "properties": {
+ "Timestamp": {
+ "description": "Timestamp for the policy state record.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceId": {
+ "description": "Resource ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionId": {
+ "description": "Policy definition ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "EffectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "$ref": "#/definitions/Column"
+ },
+ "IsCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "$ref": "#/definitions/Column"
+ },
+ "SubscriptionId": {
+ "description": "Subscription ID.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceType": {
+ "description": "Resource type.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceLocation": {
+ "description": "Resource location.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceGroup": {
+ "description": "Resource group name.",
+ "$ref": "#/definitions/Column"
+ },
+ "ResourceTags": {
+ "description": "List of resource tags.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentName": {
+ "description": "Policy assignment name.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionName": {
+ "description": "Policy definition name.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ },
+ "ManagementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "$ref": "#/definitions/Column"
+ },
+ "PolicyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "$ref": "#/definitions/Column"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "rows": {
+ "description": "Query result rows, each representing a policy state record.",
+ "type": "array",
+ "items": {
+ "description": "Query result row.",
+ "type": "array",
+ "items": {
+ "description": "Each column of the query result row."
+ }
+ }
+ }
+ }
+ },
+ "Column": {
+ "description": "Column definition.",
+ "properties": {
+ "ordinal": {
+ "description": "Ordinal value of the column in a record.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "name": {
+ "description": "Name of the column.",
+ "type": "string"
+ },
+ "dataType": {
+ "description": "Data type of the column.",
+ "type": "string"
+ }
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "Operations": {
+ "description": "List of available operations.",
+ "properties": {
+ "value": {
+ "description": "List of available operations.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Operation"
+ }
+ }
+ }
+ },
+ "Operation": {
+ "description": "Operation definition.",
+ "properties": {
+ "name": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "display": {
+ "description": "Display metadata associated with the operation.",
+ "properties": {
+ "provider": {
+ "description": "Resource provider name.",
+ "type": "string"
+ },
+ "resource": {
+ "description": "Resource name on which the operation is performed.",
+ "type": "string"
+ },
+ "operation": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Operation description.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": {
+ "policyStatesResourceParameter": {
+ "name": "policyStatesResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default",
+ "latest"
+ ],
+ "x-ms-enum": {
+ "name": "PolicyStatesResource",
+ "modelAsString": false
+ },
+ "description": "The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s).",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management resource provider; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..9a77705b9f87
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,25 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyStates)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "NumDenyStates": 6
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..4a5653af6f3b
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,40 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))",
+ "$orderby": "NumAuditDenyNonComplianceRecords desc",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.classiccompute/domainnames/myDomainName",
+ "NumAuditDenyNonComplianceRecords": 10
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.classiccompute/domainnames/myDomainName",
+ "NumAuditDenyNonComplianceRecords": 10
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..91fb36d5f795
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,37 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/enable monitoring in azure security center",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "policyDefinitionAction": "auditifnotexists",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/89b27f38-e9e4-4468-ab81-801c84b8c017",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "policyDefinitionAction": "auditifnotexists",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..5486bac2abd0
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,111 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$filter": "IsCompliant eq false",
+ "$apply": "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))",
+ "$orderby": "NumNonCompliantResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 10,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "14799174781370023846",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "1679708035638239273",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "14799174781370023846",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "1679708035638239273",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 552
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "8935913113203900114",
+ "NumNonCompliantResources": 544
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 526
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "2124621540977569058",
+ "NumNonCompliantResources": 509
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/GetMetadata.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/GetMetadata.json
new file mode 100644
index 000000000000..45f6e3b5c72f
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/GetMetadata.json
@@ -0,0 +1,14 @@
+{
+ "parameters": {
+ "scope": "subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "headers": {
+ "content-type": "application/xml"
+ },
+ "body": " Org.OData.Capabilities.V1.ConformanceLevelType/Minimal application/json;odata.metadata=minimal;IEEE754Compatible=false;odata.streaming=true application/json;odata.metadata=none;IEEE754Compatible=false;odata.streaming=true "
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/ListOperations.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/ListOperations.json
new file mode 100644
index 000000000000..7dfa6867003f
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/ListOperations.json
@@ -0,0 +1,41 @@
+{
+ "parameters": {
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.count": 3,
+ "value": [
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Events",
+ "operation": "Query Policy Events",
+ "description": "Query information about policy events."
+ }
+ },
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy States",
+ "operation": "Query Policy States",
+ "description": "Query information about policy states."
+ }
+ },
+ {
+ "name": "latest/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Latest States",
+ "operation": "Query Policy Latest States",
+ "description": "Query information about policy latest states."
+ }
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..c14cf9a26164
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,76 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:41:47Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.insights/autoscalesettings",
+ "resourceLocation": "westus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "1ef5d536aec743a0aa801c1a",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "15521232277412542086"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:41:47Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.insights/autoscalesettings",
+ "resourceLocation": "westus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "",
+ "policySetDefinitionName": "",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": ""
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..dbc832842cc8
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..a0b163fc24e9
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,76 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T18:42:42Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Storage/storageAccounts",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T18:42:42Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Storage/storageAccounts",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..73ded1e6be65
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QueryResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..e38d715199ef
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..52f7ef267b0f
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..b0f0aa96c8a1
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:48:05Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "Enable Monitoring in Azure Security Center",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6",
+ "policyDefinitionAction": "AuditIfNotExists",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:48:05Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/9ac09b0657d942e5ad4041a6",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "9ac09b0657d942e5ad4041a6",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6",
+ "policyDefinitionAction": "AuditIfNotExists",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..cc5cc28b89d1
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,42 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-10-17-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-06T17:58:00Z",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myrg1",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Storage/storageAccounts/mysa1"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-06T17:58:00Z",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myrg2",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg2/providers/Microsoft.Storage/storageAccounts/mysa2"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/policyStates.json
new file mode 100644
index 000000000000..1045dba699eb
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/policyStates.json
@@ -0,0 +1,709 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyStatesClient",
+ "version": "2017-10-17-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForManagementGroup",
+ "description": "Queries policy states for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForSubscription",
+ "description": "Queries policy states for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResourceGroup",
+ "description": "Queries policy states for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResource",
+ "description": "Queries policy states for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query all policy states at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query all policy states at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query all policy states at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query all policy states at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ },
+ "/providers/Microsoft.PolicyInsights/operations": {
+ "get": {
+ "operationId": "PolicyInsights_ListOperations",
+ "description": "Lists available operations.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "List of available operations.",
+ "schema": {
+ "$ref": "#/definitions/Operations"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "List operations": { "$ref": "./examples/ListOperations.json" }
+ }
+ }
+ },
+ "/{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata": {
+ "get": {
+ "operationId": "PolicyStates_GetMetadata",
+ "description": "Gets OData metadata XML document.",
+ "produces": [
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/parameters/scopeParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OData metadata XML document.",
+ "schema": {
+ "$ref": "#/definitions/MetadataDocument"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Get metadata": { "$ref": "./examples/GetMetadata.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyStatesQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "@odata.count": {
+ "description": "OData entity count; represents the number of policy state records returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyState"
+ }
+ }
+ }
+ },
+ "PolicyState": {
+ "type": "object",
+ "description": "Policy state record.",
+ "properties": {
+ "@odata.id": {
+ "description": "OData entity ID; always set to null since policy state records do not have an entity ID.",
+ "type": "string"
+ },
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "Timestamp for the policy state record.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "resourceId": {
+ "description": "Resource ID.",
+ "type": "string"
+ },
+ "policyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "type": "string"
+ },
+ "policyDefinitionId": {
+ "description": "Policy definition ID.",
+ "type": "string"
+ },
+ "effectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "type": "string"
+ },
+ "isCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "type": "boolean"
+ },
+ "subscriptionId": {
+ "description": "Subscription ID.",
+ "type": "string"
+ },
+ "resourceType": {
+ "description": "Resource type.",
+ "type": "string"
+ },
+ "resourceLocation": {
+ "description": "Resource location.",
+ "type": "string"
+ },
+ "resourceGroup": {
+ "description": "Resource group name.",
+ "type": "string"
+ },
+ "resourceTags": {
+ "description": "List of resource tags.",
+ "type": "string"
+ },
+ "policyAssignmentName": {
+ "description": "Policy assignment name.",
+ "type": "string"
+ },
+ "policyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "type": "string"
+ },
+ "policyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "type": "string"
+ },
+ "policyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "type": "string"
+ },
+ "policyDefinitionName": {
+ "description": "Policy definition name.",
+ "type": "string"
+ },
+ "policyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "type": "string"
+ },
+ "policyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "type": "string"
+ },
+ "policySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "managementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "type": "string"
+ },
+ "policyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "type": "string"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "Operations": {
+ "description": "List of available operations.",
+ "properties": {
+ "@odata.count": {
+ "description": "OData entity count; represents the number of operations returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1
+ },
+ "value": {
+ "description": "List of available operations.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Operation"
+ }
+ }
+ }
+ },
+ "Operation": {
+ "description": "Operation definition.",
+ "properties": {
+ "name": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "display": {
+ "description": "Display metadata associated with the operation.",
+ "properties": {
+ "provider": {
+ "description": "Resource provider name.",
+ "type": "string"
+ },
+ "resource": {
+ "description": "Resource name on which the operation is performed.",
+ "type": "string"
+ },
+ "operation": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Operation description.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "MetadataDocument": {
+ "description": "Metadata XML document.",
+ "type": "string"
+ }
+ },
+ "parameters": {
+ "policyStatesResourceParameter": {
+ "name": "policyStatesResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default",
+ "latest"
+ ],
+ "x-ms-enum": {
+ "name": "PolicyStatesResource",
+ "modelAsString": false
+ },
+ "description": "The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s).",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management resource provider; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "scopeParameter": {
+ "name": "scope",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json
new file mode 100644
index 000000000000..41cbee61578d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndAggregateOnly.json
@@ -0,0 +1,25 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$apply": "aggregate($count as NumDenyStates)"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "NumDenyStates": 6
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json
new file mode 100644
index 000000000000..b2a9330e4602
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithAggregate.json
@@ -0,0 +1,40 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))",
+ "$orderby": "NumAuditDenyNonComplianceRecords desc",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.classiccompute/domainnames/myDomainName",
+ "NumAuditDenyNonComplianceRecords": 10
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.classiccompute/domainnames/myDomainName",
+ "NumAuditDenyNonComplianceRecords": 10
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json
new file mode 100644
index 000000000000..66b1d4313104
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndGroupByWithoutAggregate.json
@@ -0,0 +1,37 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-01-05T18:00:00Z",
+ "$filter": "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')",
+ "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/enable monitoring in azure security center",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "policyDefinitionAction": "auditifnotexists",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/89b27f38-e9e4-4468-ab81-801c84b8c017",
+ "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed",
+ "policyDefinitionAction": "auditifnotexists",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json
new file mode 100644
index 000000000000..99670597c2c8
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/FilterAndMultipleGroups.json
@@ -0,0 +1,111 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$filter": "IsCompliant eq false",
+ "$apply": "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))",
+ "$orderby": "NumNonCompliantResources desc",
+ "$top": 10
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 10,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "14799174781370023846",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "1679708035638239273",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "14799174781370023846",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "1679708035638239273",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 557
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 552
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "8935913113203900114",
+ "NumNonCompliantResources": 544
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874",
+ "policySetDefinitionId": "",
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "policyDefinitionReferenceId": "",
+ "NumNonCompliantResources": 526
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionReferenceId": "2124621540977569058",
+ "NumNonCompliantResources": 509
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/GetMetadata.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/GetMetadata.json
new file mode 100644
index 000000000000..fb8f8c3e2620
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/GetMetadata.json
@@ -0,0 +1,14 @@
+{
+ "parameters": {
+ "scope": "subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "headers": {
+ "content-type": "application/xml"
+ },
+ "body": " Org.OData.Capabilities.V1.ConformanceLevelType/Minimal application/json;odata.metadata=minimal;IEEE754Compatible=false;odata.streaming=true application/json;odata.metadata=none;IEEE754Compatible=false;odata.streaming=true "
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/ListOperations.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/ListOperations.json
new file mode 100644
index 000000000000..3de5d287b34c
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/ListOperations.json
@@ -0,0 +1,50 @@
+{
+ "parameters": {
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.count": 4,
+ "value": [
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Events",
+ "operation": "Query Policy Events",
+ "description": "Query information about policy events."
+ }
+ },
+ {
+ "name": "default/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy States",
+ "operation": "Query Policy States",
+ "description": "Query information about policy states."
+ }
+ },
+ {
+ "name": "latest/queryResults/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Latest States",
+ "operation": "Query Policy Latest States",
+ "description": "Query information about policy latest states."
+ }
+ },
+ {
+ "name": "latest/summarize/action",
+ "display": {
+ "provider": "Microsoft Policy Insights",
+ "resource": "Policy Latest States",
+ "operation": "Query Policy Latest States Summary",
+ "description": "Query summary information about policy latest states."
+ }
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json
new file mode 100644
index 000000000000..efe90a0008d0
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryManagementGroupScope.json
@@ -0,0 +1,76 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:41:47Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.insights/autoscalesettings",
+ "resourceLocation": "westus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "1ef5d536aec743a0aa801c1a",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "15521232277412542086"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:41:47Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/microsoft.insights/autoscalesettings",
+ "resourceLocation": "westus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "",
+ "policySetDefinitionName": "",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": ""
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json
new file mode 100644
index 000000000000..f726792ab748
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryNestedResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..40bab8a3e9d5
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupLevelPolicyAssignmentScope.json
@@ -0,0 +1,78 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "myPolicyAssignment",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:38:50Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Security/policies/mySecurityPolicy",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Security/policies",
+ "resourceLocation": null,
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "myPolicyAssignment",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"EUS, WEU\"]}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup",
+ "policyDefinitionName": "4a0425e4-97bf-4ad0-ab36-145b94083c60",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:38:50Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Authorization/policyAssignments",
+ "resourceLocation": null,
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "myPolicyAssignment",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"EUS, WEU\"]}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup",
+ "policyDefinitionName": "4a0425e4-97bf-4ad0-ab36-145b94083c60",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json
new file mode 100644
index 000000000000..8ff86a37b152
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceGroupScope.json
@@ -0,0 +1,76 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T18:42:42Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Storage/storageAccounts",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T18:42:42Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Storage/storageAccounts",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceScope.json
new file mode 100644
index 000000000000..94d1121594e6
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QueryResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.ClassicCompute/domainNames",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
new file mode 100644
index 000000000000..f30599819154
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelNestedResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
+ "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "186044306c044a1d8c0ff76c",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
+ "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg",
+ "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..f95cc04233bb
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyAssignmentScope.json
@@ -0,0 +1,77 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:45:19Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/my-ip-1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"test\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "c8b79b49-a579-4045-984e-1b249ab8b474",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "2124621540977569058"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:45:19Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/my-ip-1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"test\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": "14799174781370023846"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json
new file mode 100644
index 000000000000..e7628e99e314
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicyDefinitionScope.json
@@ -0,0 +1,77 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:50:27Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/d9da7e80af6344ab9d342aa7",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications/services",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d9da7e80af6344ab9d342aa7",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"MyTag\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:50:27Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/d9da7e80af6344ab9d342aa7",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.ServiceFabric/clusters/applications/services",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "d9da7e80af6344ab9d342aa7",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"MyTag\"}}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json
new file mode 100644
index 000000000000..61a473d612c6
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelPolicySetDefinitionScope.json
@@ -0,0 +1,77 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:54:58Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/mySite",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Web/sites",
+ "resourceLocation": "centralus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-13T00:54:58Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/mySite",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29",
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/LocationAuditDefinition",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Web/sites",
+ "resourceLocation": "centralus",
+ "resourceGroup": "myResourceGroup",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "3f3c4330183b4e218fe6fd29",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "LocationAuditDefinition",
+ "policyDefinitionAction": "Audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json
new file mode 100644
index 000000000000..7c841710898e
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionLevelResourceScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "default",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity",
+ "timestamp": "2018-02-09T16:04:31Z",
+ "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName",
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test",
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "resourceType": "/Microsoft.SomeNamespace/someResourceType",
+ "resourceLocation": "eastus",
+ "resourceGroup": "",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "test",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}",
+ "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5",
+ "policyDefinitionName": "Audit a tag and it's value",
+ "policyDefinitionAction": "audit",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": null,
+ "policySetDefinitionName": null,
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json
new file mode 100644
index 000000000000..8ddcc6ffcab3
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/QuerySubscriptionScope.json
@@ -0,0 +1,75 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:48:05Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "Enable Monitoring in Azure Security Center",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6",
+ "policyDefinitionAction": "AuditIfNotExists",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-09T17:48:05Z",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1",
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/9ac09b0657d942e5ad4041a6",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6",
+ "effectiveParameters": null,
+ "isCompliant": false,
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceType": "/Microsoft.Network/publicIPAddresses",
+ "resourceLocation": "eastus",
+ "resourceGroup": "myrg1",
+ "resourceTags": "tbd",
+ "policyAssignmentName": "9ac09b0657d942e5ad4041a6",
+ "policyAssignmentOwner": "tbd",
+ "policyAssignmentParameters": "{}",
+ "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6",
+ "policyDefinitionAction": "AuditIfNotExists",
+ "policyDefinitionCategory": "tbd",
+ "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
+ "policySetDefinitionOwner": null,
+ "policySetDefinitionCategory": null,
+ "policySetDefinitionParameters": null,
+ "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47",
+ "policyDefinitionReferenceId": null
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeManagementGroupScope.json
new file mode 100644
index 000000000000..1aacf3df0b2a
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeManagementGroupScope.json
@@ -0,0 +1,32 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "managementGroupsNamespace": "Microsoft.Management",
+ "managementGroupName": "myManagementGroup",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit'",
+ "$top": 0
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-05 18:00:00Z&$to=2018-02-06 18:00:00Z&$filter=(PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit') and IsCompliant eq false",
+ "nonCompliantResources": 15410,
+ "nonCompliantPolicies": 68
+ },
+ "policyAssignments": []
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..09f4625afaba
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupLevelPolicyAssignmentScope.json
@@ -0,0 +1,49 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "b7a1ca2596524e3ab19597f2",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 7,
+ "nonCompliantPolicies": 1
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2'",
+ "nonCompliantResources": 7,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60'",
+ "nonCompliantResources": 7
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupScope.json
new file mode 100644
index 000000000000..147569e8323f
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceGroupScope.json
@@ -0,0 +1,67 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroupName": "myResourceGroup",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 55,
+ "nonCompliantPolicies": 20
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c'",
+ "nonCompliantResources": 55,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'",
+ "nonCompliantResources": 55
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a",
+ "policySetDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'",
+ "nonCompliantResources": 55,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'",
+ "nonCompliantResources": 55
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceScope.json
new file mode 100644
index 000000000000..4721644012fb
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeResourceScope.json
@@ -0,0 +1,334 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 14
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a",
+ "policySetDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/bafcd34b-58c6-47b4-bc8b-f35198d6a025",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/test",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/testtest'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/e4a08f18-4e3e-47af-a2eb-cc96d8c9a01f",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 2
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and its value",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and its value'",
+ "nonCompliantResources": 1
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/deny a resource based on owner tag",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 3
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition'",
+ "nonCompliantResources": 1
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 1
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1'",
+ "nonCompliantResources": 1,
+ "nonCompliantPolicies": 3
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition'",
+ "nonCompliantResources": 1
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 1
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 1
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyAssignmentScope.json
new file mode 100644
index 000000000000..827514a8d3cd
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyAssignmentScope.json
@@ -0,0 +1,73 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 531,
+ "nonCompliantPolicies": 1
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'",
+ "nonCompliantResources": 531,
+ "nonCompliantPolicies": 4
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 531
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 531
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition'",
+ "nonCompliantResources": 220
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682'",
+ "nonCompliantResources": 54
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyDefinitionScope.json
new file mode 100644
index 000000000000..11c50f5e2540
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicyDefinitionScope.json
@@ -0,0 +1,106 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1",
+ "api-version": "2017-12-12-preview"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 561,
+ "nonCompliantPolicies": 4
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'",
+ "nonCompliantResources": 558,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 558
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'",
+ "nonCompliantResources": 553,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 553
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1'",
+ "nonCompliantResources": 531,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 531
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'",
+ "nonCompliantResources": 531,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 531
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicySetDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicySetDefinitionScope.json
new file mode 100644
index 000000000000..6b609fed669d
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionLevelPolicySetDefinitionScope.json
@@ -0,0 +1,33 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "authorizationNamespace": "Microsoft.Authorization",
+ "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$filter": "PolicyDefinitionAction eq 'deny'",
+ "$top": 1
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-05 18:00:00Z&$to=2018-02-06 18:00:00Z&$filter=(PolicyDefinitionAction eq 'deny') and IsCompliant eq false",
+ "nonCompliantResources": 0,
+ "nonCompliantPolicies": 0
+ },
+ "policyAssignments": []
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionScope.json
new file mode 100644
index 000000000000..34e5a0c99b89
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/SummarizeSubscriptionScope.json
@@ -0,0 +1,140 @@
+{
+ "parameters": {
+ "policyStatesSummaryResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$top": 5
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary",
+ "@odata.count": 1,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false",
+ "nonCompliantResources": 619,
+ "nonCompliantPolicies": 40
+ },
+ "policyAssignments": [
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01'",
+ "nonCompliantResources": 557,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 557
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'",
+ "nonCompliantResources": 557,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 557
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49",
+ "policySetDefinitionId": "",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49'",
+ "nonCompliantResources": 557,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'",
+ "nonCompliantResources": 557
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a",
+ "policySetDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'",
+ "nonCompliantResources": 557,
+ "nonCompliantPolicies": 1
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'",
+ "nonCompliantResources": 557
+ }
+ }
+ ]
+ },
+ {
+ "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
+ "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'",
+ "nonCompliantResources": 552,
+ "nonCompliantPolicies": 3
+ },
+ "policyDefinitions": [
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'",
+ "nonCompliantResources": 552
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition'",
+ "nonCompliantResources": 29
+ }
+ },
+ {
+ "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682",
+ "effect": "audit",
+ "results": {
+ "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2017-12-12-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682'",
+ "nonCompliantResources": 2
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json
new file mode 100644
index 000000000000..9d9e4f61d44f
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/examples/TimeRangeSortSelectTop.json
@@ -0,0 +1,42 @@
+{
+ "parameters": {
+ "policyStatesResource": "latest",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "api-version": "2017-12-12-preview",
+ "$from": "2018-02-05T18:00:00Z",
+ "$to": "2018-02-06T18:00:00Z",
+ "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId",
+ "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId",
+ "$top": 2
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
+ "@odata.count": 2,
+ "value": [
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-06T17:58:00Z",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myrg1",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Storage/storageAccounts/mysa1"
+ },
+ {
+ "@odata.id": null,
+ "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
+ "timestamp": "2018-02-06T17:58:00Z",
+ "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb",
+ "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
+ "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
+ "resourceGroup": "myrg2",
+ "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg2/providers/Microsoft.Storage/storageAccounts/mysa2"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/policyStates.json
new file mode 100644
index 000000000000..ff60596be33e
--- /dev/null
+++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/policyStates.json
@@ -0,0 +1,1512 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "PolicyStatesClient",
+ "version": "2017-12-12-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForManagementGroup",
+ "description": "Queries policy states for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at management group scope": { "$ref": "./examples/QueryManagementGroupScope.json" }
+ }
+ }
+ },
+ "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForManagementGroup",
+ "description": "Summarizes policy states for the resources under the management group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupsNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/managementGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at management group scope": { "$ref": "./examples/SummarizeManagementGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForSubscription",
+ "description": "Queries policy states for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription scope": { "$ref": "./examples/QuerySubscriptionScope.json" },
+ "Time range; sort, select and limit": { "$ref": "./examples/TimeRangeSortSelectTop.json" },
+ "Filter and group with aggregate": { "$ref": "./examples/FilterAndGroupByWithAggregate.json" },
+ "Filter and group without aggregate": { "$ref": "./examples/FilterAndGroupByWithoutAggregate.json" },
+ "Filter and aggregate only": { "$ref": "./examples/FilterAndAggregateOnly.json" },
+ "Filter and multiple groups": { "$ref": "./examples/FilterAndMultipleGroups.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForSubscription",
+ "description": "Summarizes policy states for the resources under the subscription.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at subscription scope": { "$ref": "./examples/SummarizeSubscriptionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResourceGroup",
+ "description": "Queries policy states for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at resource group scope": { "$ref": "./examples/QueryResourceGroupScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForResourceGroup",
+ "description": "Summarizes policy states for the resources under the resource group.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at resource group scope": { "$ref": "./examples/SummarizeResourceGroupScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResource",
+ "description": "Queries policy states for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query all policy states at resource scope": { "$ref": "./examples/QueryResourceScope.json" },
+ "Query all policy states at subscription level resource scope": { "$ref": "./examples/QuerySubscriptionLevelResourceScope.json" },
+ "Query all policy states at nested resource scope": { "$ref": "./examples/QueryNestedResourceScope.json" },
+ "Query all policy states at subscription level nested resource scope": { "$ref": "./examples/QuerySubscriptionLevelNestedResourceScope.json" }
+ }
+ }
+ },
+ "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForResource",
+ "description": "Summarizes policy states for the resource.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceIdParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at resource scope": { "$ref": "./examples/SummarizeResourceScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForPolicySetDefinition",
+ "description": "Queries policy states for the subscription level policy set definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policySetDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription level policy set definition scope": { "$ref": "./examples/QuerySubscriptionLevelPolicySetDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForPolicySetDefinition",
+ "description": "Summarizes policy states for the subscription level policy set definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policySetDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at policy set definition scope": { "$ref": "./examples/SummarizeSubscriptionLevelPolicySetDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForPolicyDefinition",
+ "description": "Queries policy states for the subscription level policy definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription level policy definition scope": { "$ref": "./examples/QuerySubscriptionLevelPolicyDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForPolicyDefinition",
+ "description": "Summarizes policy states for the subscription level policy definition.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyDefinitionNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at policy definition scope": { "$ref": "./examples/SummarizeSubscriptionLevelPolicyDefinitionScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForSubscriptionLevelPolicyAssignment",
+ "description": "Queries policy states for the subscription level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at subscription level policy assignment scope": { "$ref": "./examples/QuerySubscriptionLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForSubscriptionLevelPolicyAssignment",
+ "description": "Summarizes policy states for the subscription level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at policy assignment scope": { "$ref": "./examples/SummarizeSubscriptionLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": {
+ "post": {
+ "operationId": "PolicyStates_ListQueryResultsForResourceGroupLevelPolicyAssignment",
+ "description": "Queries policy states for the resource group level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/orderByParameter"
+ },
+ {
+ "$ref": "#/parameters/selectParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ },
+ {
+ "$ref": "#/parameters/applyParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Query results.",
+ "schema": {
+ "$ref": "#/definitions/PolicyStatesQueryResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Query latest at resource group level policy assignment scope": { "$ref": "./examples/QueryResourceGroupLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": {
+ "post": {
+ "operationId": "PolicyStates_SummarizeForResourceGroupLevelPolicyAssignment",
+ "description": "Summarizes policy states for the resource group level policy assignment.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/policyStatesSummaryResourceParameter"
+ },
+ {
+ "$ref": "#/parameters/subscriptionIdParameter"
+ },
+ {
+ "$ref": "#/parameters/resourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/authorizationNamespaceParameter"
+ },
+ {
+ "$ref": "#/parameters/policyAssignmentNameParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ },
+ {
+ "$ref": "#/parameters/topParameter"
+ },
+ {
+ "$ref": "#/parameters/fromParameter"
+ },
+ {
+ "$ref": "#/parameters/toParameter"
+ },
+ {
+ "$ref": "#/parameters/filterParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Summarize results.",
+ "schema": {
+ "$ref": "#/definitions/SummarizeResults"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Summarize at policy assignment scope": { "$ref": "./examples/SummarizeResourceGroupLevelPolicyAssignmentScope.json" }
+ }
+ }
+ },
+ "/providers/Microsoft.PolicyInsights/operations": {
+ "get": {
+ "operationId": "PolicyInsights_ListOperations",
+ "description": "Lists available operations.",
+ "parameters": [
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "List of available operations.",
+ "schema": {
+ "$ref": "#/definitions/Operations"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "List operations": { "$ref": "./examples/ListOperations.json" }
+ }
+ }
+ },
+ "/{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata": {
+ "get": {
+ "operationId": "PolicyStates_GetMetadata",
+ "description": "Gets OData metadata XML document.",
+ "produces": [
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/parameters/scopeParameter"
+ },
+ {
+ "$ref": "#/parameters/apiVersionParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OData metadata XML document.",
+ "schema": {
+ "$ref": "#/definitions/MetadataDocument"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "#/definitions/QueryFailure"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Get metadata": { "$ref": "./examples/GetMetadata.json" }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "PolicyStatesQueryResults": {
+ "description": "Query results.",
+ "properties": {
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "@odata.count": {
+ "description": "OData entity count; represents the number of policy state records returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "value": {
+ "description": "Query results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyState"
+ }
+ }
+ }
+ },
+ "PolicyState": {
+ "type": "object",
+ "description": "Policy state record.",
+ "properties": {
+ "@odata.id": {
+ "description": "OData entity ID; always set to null since policy state records do not have an entity ID.",
+ "type": "string"
+ },
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "Timestamp for the policy state record.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "resourceId": {
+ "description": "Resource ID.",
+ "type": "string"
+ },
+ "policyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "type": "string"
+ },
+ "policyDefinitionId": {
+ "description": "Policy definition ID.",
+ "type": "string"
+ },
+ "effectiveParameters": {
+ "description": "Effective parameters for the policy assignment.",
+ "type": "string"
+ },
+ "isCompliant": {
+ "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.",
+ "type": "boolean"
+ },
+ "subscriptionId": {
+ "description": "Subscription ID.",
+ "type": "string"
+ },
+ "resourceType": {
+ "description": "Resource type.",
+ "type": "string"
+ },
+ "resourceLocation": {
+ "description": "Resource location.",
+ "type": "string"
+ },
+ "resourceGroup": {
+ "description": "Resource group name.",
+ "type": "string"
+ },
+ "resourceTags": {
+ "description": "List of resource tags.",
+ "type": "string"
+ },
+ "policyAssignmentName": {
+ "description": "Policy assignment name.",
+ "type": "string"
+ },
+ "policyAssignmentOwner": {
+ "description": "Policy assignment owner.",
+ "type": "string"
+ },
+ "policyAssignmentParameters": {
+ "description": "Policy assignment parameters.",
+ "type": "string"
+ },
+ "policyAssignmentScope": {
+ "description": "Policy assignment scope.",
+ "type": "string"
+ },
+ "policyDefinitionName": {
+ "description": "Policy definition name.",
+ "type": "string"
+ },
+ "policyDefinitionAction": {
+ "description": "Policy definition action, i.e. effect.",
+ "type": "string"
+ },
+ "policyDefinitionCategory": {
+ "description": "Policy definition category.",
+ "type": "string"
+ },
+ "policySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionName": {
+ "description": "Policy set definition name, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionOwner": {
+ "description": "Policy set definition owner, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionCategory": {
+ "description": "Policy set definition category, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "policySetDefinitionParameters": {
+ "description": "Policy set definition parameters, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "managementGroupIds": {
+ "description": "Comma seperated list of management group IDs, which represent the hierarchy of the management groups the resource is under.",
+ "type": "string"
+ },
+ "policyDefinitionReferenceId": {
+ "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.",
+ "type": "string"
+ }
+ },
+ "additionalProperties": {
+ "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated"
+ }
+ },
+ "SummarizeResults": {
+ "description": "Summarize action results.",
+ "properties": {
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "@odata.count": {
+ "description": "OData entity count; represents the number of summaries returned; always set to 1.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "maximum": 1
+ },
+ "value": {
+ "description": "Summarize action results.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Summary"
+ }
+ }
+ }
+ },
+ "Summary": {
+ "description": "Summary results.",
+ "properties": {
+ "@odata.id": {
+ "description": "OData entity ID; always set to null since summaries do not have an entity ID.",
+ "type": "string"
+ },
+ "@odata.context": {
+ "description": "OData context string; used by OData clients to resolve type information based on metadata.",
+ "type": "string"
+ },
+ "results": {
+ "description": "Non-compliance summary for all policy assignments.",
+ "$ref": "#/definitions/SummaryResults"
+ },
+ "policyAssignments": {
+ "description": "Policy assignments summary.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyAssignmentSummary"
+ }
+ }
+ }
+ },
+ "SummaryResults": {
+ "description": "Non-compliance summary on a particular summary level.",
+ "properties": {
+ "queryResultsUri": {
+ "description": "HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the non-compliance summary.",
+ "type": "string"
+ },
+ "nonCompliantResources": {
+ "description": "Number of non-compliant resources.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ },
+ "nonCompliantPolicies": {
+ "description": "Number of non-compliant policies.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+ },
+ "PolicyAssignmentSummary": {
+ "description": "Policy assignment summary.",
+ "properties": {
+ "policyAssignmentId": {
+ "description": "Policy assignment ID.",
+ "type": "string"
+ },
+ "policySetDefinitionId": {
+ "description": "Policy set definition ID, if the policy assignment is for a policy set.",
+ "type": "string"
+ },
+ "results": {
+ "description": "Non-compliance summary for the policy assignment.",
+ "$ref": "#/definitions/SummaryResults"
+ },
+ "policyDefinitions": {
+ "description": "Policy definitions summary.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyDefinitionSummary"
+ }
+ }
+ }
+ },
+ "PolicyDefinitionSummary": {
+ "description": "Policy definition summary.",
+ "properties": {
+ "policyDefinitionId": {
+ "description": "Policy definition ID.",
+ "type": "string"
+ },
+ "effect": {
+ "description": "Policy effect, i.e. policy definition action.",
+ "type": "string"
+ },
+ "results": {
+ "description": "Non-compliance summary for the policy definition.",
+ "$ref": "#/definitions/SummaryResults"
+ }
+ }
+ },
+ "QueryFailure": {
+ "description": "Error response.",
+ "properties": {
+ "error": {
+ "description": "Error definition.",
+ "properties": {
+ "code": {
+ "description": "Service specific error code which serves as the substatus for the HTTP error code.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Description of the error.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "Operations": {
+ "description": "List of available operations.",
+ "properties": {
+ "@odata.count": {
+ "description": "OData entity count; represents the number of operations returned.",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1
+ },
+ "value": {
+ "description": "List of available operations.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Operation"
+ }
+ }
+ }
+ },
+ "Operation": {
+ "description": "Operation definition.",
+ "properties": {
+ "name": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "display": {
+ "description": "Display metadata associated with the operation.",
+ "properties": {
+ "provider": {
+ "description": "Resource provider name.",
+ "type": "string"
+ },
+ "resource": {
+ "description": "Resource name on which the operation is performed.",
+ "type": "string"
+ },
+ "operation": {
+ "description": "Operation name.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Operation description.",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "MetadataDocument": {
+ "description": "Metadata XML document.",
+ "type": "string"
+ }
+ },
+ "parameters": {
+ "policyStatesResourceParameter": {
+ "name": "policyStatesResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "default",
+ "latest"
+ ],
+ "x-ms-enum": {
+ "name": "PolicyStatesResource",
+ "modelAsString": false
+ },
+ "description": "The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s).",
+ "x-ms-parameter-location": "method"
+ },
+ "policyStatesSummaryResourceParameter": {
+ "name": "policyStatesSummaryResource",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "latest"
+ ],
+ "description": "The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupsNamespaceParameter": {
+ "name": "managementGroupsNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Management"
+ ],
+ "description": "The namespace for Microsoft Management RP; only \"Microsoft.Management\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "managementGroupNameParameter": {
+ "name": "managementGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Management group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "subscriptionIdParameter": {
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Microsoft Azure subscription ID.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceGroupNameParameter": {
+ "name": "resourceGroupName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource group name.",
+ "x-ms-parameter-location": "method"
+ },
+ "resourceIdParameter": {
+ "name": "resourceId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Resource ID.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "authorizationNamespaceParameter": {
+ "name": "authorizationNamespace",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "Microsoft.Authorization"
+ ],
+ "description": "The namespace for Microsoft Authorization resource provider; only \"Microsoft.Authorization\" is allowed.",
+ "x-ms-parameter-location": "method"
+ },
+ "policySetDefinitionNameParameter": {
+ "name": "policySetDefinitionName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy set definition name.",
+ "x-ms-parameter-location": "method"
+ },
+ "policyDefinitionNameParameter": {
+ "name": "policyDefinitionName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy definition name.",
+ "x-ms-parameter-location": "method"
+ },
+ "policyAssignmentNameParameter": {
+ "name": "policyAssignmentName",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Policy assignment name.",
+ "x-ms-parameter-location": "method"
+ },
+ "scopeParameter": {
+ "name": "scope",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.",
+ "x-ms-parameter-location": "method",
+ "x-ms-skip-url-encoding": true
+ },
+ "apiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "type": "string",
+ "description": "API version to use with the client requests.",
+ "x-ms-parameter-location": "client"
+ },
+ "topParameter": {
+ "name": "$top",
+ "in": "query",
+ "required": false,
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Maximum number of records to return.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Top"
+ },
+ "orderByParameter": {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "OrderBy"
+ },
+ "selectParameter": {
+ "name": "$select",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Select"
+ },
+ "fromParameter": {
+ "name": "$from",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "From"
+ },
+ "toParameter": {
+ "name": "$to",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "format": "date-time",
+ "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "To"
+ },
+ "filterParameter": {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData filter expression.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Filter"
+ },
+ "applyParameter": {
+ "name": "$apply",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData apply expression for aggregations.",
+ "x-ms-parameter-location": "method",
+ "x-ms-parameter-grouping": {
+ "name": "QueryOptions"
+ },
+ "x-ms-client-name": "Apply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/policyinsights/resource-manager/readme.md b/specification/policyinsights/resource-manager/readme.md
new file mode 100644
index 000000000000..5a4420c13852
--- /dev/null
+++ b/specification/policyinsights/resource-manager/readme.md
@@ -0,0 +1,214 @@
+# PolicyInsights
+
+> see https://aka.ms/autorest
+
+This is the AutoRest configuration file for PolicyInsights.
+
+
+
+---
+## Getting Started
+To build the SDK for PolicyInsights, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:
+
+> `autorest`
+
+To see additional help and options, run:
+
+> `autorest --help`
+---
+
+## Configuration
+
+
+
+### Basic Information
+These are the global settings for the PolicyInsights API.
+
+``` yaml
+title: PolicyInsightsClient
+openapi-type: arm
+azure-validator: true
+tag: package-2017-12
+```
+
+### Validations
+Run validations when `--validate` is specified on command line
+
+``` yaml $(validate)
+azure-validator: true
+semantic-validator: true
+model-validator: true
+message-format: json
+```
+
+## Suppression
+``` yaml
+directive:
+ - suppress: EnumInsteadOfBoolean
+ reason: The data type in store is boolean. If we change the type in RP, it will break existing clients, and we will incur runtime conversion cost.
+ where:
+ - $.definitions.PolicyEvent.properties.isCompliant
+ - $.definitions.PolicyState.properties.isCompliant
+
+ - suppress: NonApplicationJsonType
+ reason: ODATA $metadata endpoint for each resource type returns metadata document as XML.
+ where:
+ - $.paths["/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata"].get.produces[0]
+ - $.paths["/{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata"].get.produces[0]
+
+```
+
+### Tag: package-2017-12
+
+These settings apply only when `--tag=package-2017-12` is specified on the command line.
+
+``` yaml $(tag) == 'package-2017-12'
+input-file:
+- Microsoft.PolicyInsights/PolicyEvents/preview/2017-12-12-preview/policyEvents.json
+- Microsoft.PolicyInsights/PolicyStates/preview/2017-12-12-preview/policyStates.json
+```
+
+
+### Tag: package-2017-10
+
+These settings apply only when `--tag=package-2017-10` is specified on the command line.
+
+``` yaml $(tag) == 'package-2017-10'
+input-file:
+- Microsoft.PolicyInsights/PolicyEvents/preview/2017-10-17-preview/policyEvents.json
+- Microsoft.PolicyInsights/PolicyStates/preview/2017-10-17-preview/policyStates.json
+```
+
+
+### Tag: package-2017-08
+
+These settings apply only when `--tag=package-2017-08` is specified on the command line.
+
+``` yaml $(tag) == 'package-2017-08'
+input-file:
+- Microsoft.PolicyInsights/PolicyEvents/preview/2017-08-09-preview/policyEvents.json
+- Microsoft.PolicyInsights/PolicyStates/preview/2017-08-09-preview/policyStates.json
+```
+
+
+---
+# Code Generation
+
+
+## Swagger to SDK
+
+This section describes what SDK should be generated by the automatic system.
+This is not used by Autorest itself.
+
+``` yaml $(swagger-to-sdk)
+swagger-to-sdk:
+ - repo: azure-sdk-for-python
+ - repo: azure-libraries-for-java
+ - repo: azure-sdk-for-go
+```
+
+
+## C#
+
+These settings apply only when `--csharp` is specified on the command line.
+Please also specify `--csharp-sdks-folder=`.
+
+``` yaml $(csharp)
+csharp:
+ azure-arm: true
+ license-header: MICROSOFT_MIT_NO_VERSION
+ namespace: Microsoft.Azure.Management.PolicyInsights
+ output-folder: $(csharp-sdks-folder)/PolicyInsights/Management/Management.PolicyInsights/Generated
+ clear-output-folder: true
+```
+
+## Python
+
+These settings apply only when `--python` is specified on the command line.
+Please also specify `--python-sdks-folder=`.
+Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.
+
+``` yaml $(python)
+python-mode: create
+python:
+ azure-arm: true
+ license-header: MICROSOFT_MIT_NO_VERSION
+ payload-flattening-threshold: 2
+ namespace: azure.mgmt.policyinsights
+ package-name: azure-mgmt-policyinsights
+ clear-output-folder: true
+```
+``` yaml $(python) && $(python-mode) == 'update'
+python:
+ no-namespace-folders: true
+ output-folder: $(python-sdks-folder)/azure-mgmt-policyinsights/azure/mgmt/policyinsights
+```
+``` yaml $(python) && $(python-mode) == 'create'
+python:
+ basic-setup-py: true
+ output-folder: $(python-sdks-folder)/azure-mgmt-policyinsights
+```
+
+
+## Go
+
+These settings apply only when `--go` is specified on the command line.
+
+``` yaml $(go)
+go:
+ license-header: MICROSOFT_APACHE_NO_VERSION
+ namespace: policyinsights
+ clear-output-folder: true
+```
+
+### Go multi-api
+
+``` yaml $(go) && $(multiapi)
+batch:
+ - tag: package-2017-12
+ - tag: package-2017-10
+ - tag: package-2017-08
+```
+
+### Tag: package-2017-12 and go
+
+These settings apply only when `--tag=package-2017-12 --go` is specified on the command line.
+Please also specify `--go-sdk-folder=`.
+
+``` yaml $(tag) == 'package-2017-12' && $(go)
+output-folder: $(go-sdk-folder)/services/policyinsights/mgmt/2017-12-12-preview/policyinsights
+```
+
+### Tag: package-2017-10 and go
+
+These settings apply only when `--tag=package-2017-10 --go` is specified on the command line.
+Please also specify `--go-sdk-folder=`.
+
+``` yaml $(tag) == 'package-2017-10' && $(go)
+output-folder: $(go-sdk-folder)/services/policyinsights/mgmt/2017-10-17-preview/policyinsights
+```
+
+### Tag: package-2017-08 and go
+
+These settings apply only when `--tag=package-2017-08 --go` is specified on the command line.
+Please also specify `--go-sdk-folder=`.
+
+``` yaml $(tag) == 'package-2017-08' && $(go)
+output-folder: $(go-sdk-folder)/services/policyinsights/mgmt/2017-08-09-preview/policyinsights
+```
+
+
+## Java
+
+These settings apply only when `--java` is specified on the command line.
+Please also specify `--azure-libraries-for-java-folder=`.
+
+``` yaml $(java)
+java:
+ azure-arm: true
+ fluent: true
+ namespace: com.microsoft.azure.management.policyinsights
+ license-header: MICROSOFT_MIT_NO_CODEGEN
+ payload-flattening-threshold: 1
+ output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-policyinsights
+```
\ No newline at end of file