Dela via


Policy States - Summarize For Subscription

Sammanfattar principtillstånd för resurserna under prenumerationen.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2019-10-01
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2019-10-01&$top={$top}&$from={$from}&$to={$to}&$filter={$filter}

URI-parametrar

Name I Obligatorisk Typ Description
policyStatesSummaryResource
path True

PolicyStatesSummaryResourceType

Den virtuella resursen under PrincipTillstånd resurstyp för sammanfattningsåtgärd. I ett angivet tidsintervall representerar "senaste" de senaste principtillstånden och är det enda tillåtna värdet.

subscriptionId
path True

string

Prenumerations-ID för Microsoft Azure.

api-version
query True

string

Klient-API-version.

$filter
query

string

OData-filteruttryck.

$from
query

string

date-time

ISO 8601-formaterad tidsstämpel som anger starttiden för intervallet som ska frågas. När tjänsten inte har angetts används ($to – 1 dag).

$to
query

string

date-time

ISO 8601-formaterad tidsstämpel som anger sluttiden för intervallet som ska frågas. När det inte anges använder tjänsten begärandetiden.

$top
query

integer

int32

Maximalt antal poster som ska returneras.

Svar

Name Typ Description
200 OK

SummarizeResults

Sammanfatta resultat.

Other Status Codes

QueryFailure

Felsvar som beskriver varför åtgärden misslyckades.

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

Typ: oauth2
Flow: implicit
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize

Omfattningar

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

Summarize at subscription scope
Summarize at subscription scope for a policy definition group

Summarize at subscription scope

Exempelbegäran

POST https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2019-10-01&$top=5

Exempelsvar

{
  "@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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter=IsCompliant eq false",
        "nonCompliantResources": 619,
        "nonCompliantPolicies": 40,
        "resourceDetails": [
          {
            "complianceState": "compliant",
            "count": 140
          },
          {
            "complianceState": "noncompliant",
            "count": 619
          }
        ],
        "policyDetails": [
          {
            "complianceState": "noncompliant",
            "count": 1
          }
        ],
        "policyGroupDetails": [
          {
            "complianceState": "noncompliant",
            "count": 1
          }
        ]
      },
      "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 557
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
              "policyDefinitionReferenceId": "1b249ab8b4741b249ab8b474",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "group1",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames and PolicySetDefinitiontId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad' and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and 'group1' IN PolicyDefinitionGroupNames",
                "nonCompliantResources": 531,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        },
        {
          "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 557
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
              "policyDefinitionReferenceId": "",
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter=PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 14
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        },
        {
          "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 557
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474",
              "policyDefinitionReferenceId": "",
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter=PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49'",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 14
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        },
        {
          "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 557
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
              "policyDefinitionReferenceId": "2134906828137356512",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "group1",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames and PolicySetDefinitiontId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5' and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and 'group1' IN PolicyDefinitionGroupNames",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        },
        {
          "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 552
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 3
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
              "policyDefinitionReferenceId": "5434906828137356512",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 552
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            },
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition",
              "policyDefinitionReferenceId": "8724906828137356512",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 29
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            },
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682",
              "policyDefinitionReferenceId": "7254906828137356512",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-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,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 2
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "group1",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames and PolicySetDefinitiontId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c' and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and 'group1' IN PolicyDefinitionGroupNames",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 140
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 552
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 3
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}

Summarize at subscription scope for a policy definition group

Exempelbegäran

POST https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2019-10-01&$top=1&$filter='group1' IN PolicyDefinitionGroupNames

Exempelsvar

{
  "@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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames",
        "nonCompliantResources": 557,
        "nonCompliantPolicies": 1,
        "resourceDetails": [
          {
            "complianceState": "compliant",
            "count": 140
          },
          {
            "complianceState": "noncompliant",
            "count": 17
          }
        ],
        "policyDetails": [
          {
            "complianceState": "noncompliant",
            "count": 1
          }
        ],
        "policyGroupDetails": [
          {
            "complianceState": "noncompliant",
            "count": 1
          }
        ]
      },
      "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=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01'",
            "nonCompliantResources": 557,
            "nonCompliantPolicies": 1,
            "resourceDetails": [
              {
                "complianceState": "compliant",
                "count": 140
              },
              {
                "complianceState": "noncompliant",
                "count": 17
              }
            ],
            "policyDetails": [
              {
                "complianceState": "noncompliant",
                "count": 2
              }
            ],
            "policyGroupDetails": [
              {
                "complianceState": "noncompliant",
                "count": 1
              }
            ]
          },
          "policyDefinitions": [
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/ab379b49-a579-4045-984e-1b249ab8b474",
              "policyDefinitionReferenceId": "1595906828137356523",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames 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/ab379b49-a579-4045-984e-1b249ab8b474'",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 14
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            },
            {
              "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
              "policyDefinitionReferenceId": "2134906828137356512",
              "policyDefinitionGroupNames": [
                "group1"
              ],
              "effect": "audit",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames 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/24813039-7534-408a-9842-eb99f45721b1'",
                "nonCompliantResources": 34,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 510
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 34
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ],
          "policyGroups": [
            {
              "policyGroupName": "group1",
              "results": {
                "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&$from=2019-10-12 19:48:53Z&$to=2019-10-13 19:48:53Z&$filter='group1' IN PolicyDefinitionGroupNames and PolicySetDefinitiontId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad' and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and 'group1' IN PolicyDefinitionGroupNames",
                "nonCompliantResources": 557,
                "resourceDetails": [
                  {
                    "complianceState": "compliant",
                    "count": 14
                  },
                  {
                    "complianceState": "noncompliant",
                    "count": 557
                  }
                ],
                "policyDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 2
                  }
                ],
                "policyGroupDetails": [
                  {
                    "complianceState": "noncompliant",
                    "count": 1
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}

Definitioner

Name Description
ComplianceDetail

Sammanslagning av efterlevnadstillstånd.

Error

Feldefinition.

PolicyAssignmentSummary

Sammanfattning av principtilldelning.

PolicyDefinitionSummary

Sammanfattning av principdefinition.

PolicyGroupSummary

Sammanfattning av principdefinitionsgrupp.

PolicyStatesSummaryResourceType

Den virtuella resursen under PrincipTillstånd resurstyp för sammanfattningsåtgärd. I ett angivet tidsintervall representerar "senaste" de senaste principtillstånden och är det enda tillåtna värdet.

QueryFailure

Felsvar.

SummarizeResults

Sammanfatta åtgärdsresultat.

Summary

Sammanfattningsresultat.

SummaryResults

Efterlevnadssammanfattning på en viss sammanfattningsnivå.

ComplianceDetail

Sammanslagning av efterlevnadstillstånd.

Name Typ Description
complianceState

string

Efterlevnadstillståndet.

count

integer

Sammanfattat antalsvärde för det här efterlevnadstillståndet.

Error

Feldefinition.

Name Typ Description
code

string

Tjänstspecifik felkod som fungerar som understatus för HTTP-felkoden.

message

string

Beskrivning av felet.

PolicyAssignmentSummary

Sammanfattning av principtilldelning.

Name Typ Description
policyAssignmentId

string

Principtilldelnings-ID.

policyDefinitions

PolicyDefinitionSummary[]

Sammanfattning av principdefinitioner.

policyGroups

PolicyGroupSummary[]

Sammanfattning av principdefinitionsgrupp.

policySetDefinitionId

string

Definitions-ID för principuppsättning, om principtilldelningen är för en principuppsättning.

results

SummaryResults

Efterlevnadssammanfattning för principtilldelningen.

PolicyDefinitionSummary

Sammanfattning av principdefinition.

Name Typ Description
effect

string

Principeffekt, d.v.s. principdefinitionsåtgärd.

policyDefinitionGroupNames

string[]

Grupnamn för principdefinition.

policyDefinitionId

string

Principdefinitions-ID.

policyDefinitionReferenceId

string

Referens-ID för principdefinition.

results

SummaryResults

Efterlevnadssammanfattning för principdefinitionen.

PolicyGroupSummary

Sammanfattning av principdefinitionsgrupp.

Name Typ Description
policyGroupName

string

Namn på principgrupp.

results

SummaryResults

Efterlevnadssammanfattning för principdefinitionsgruppen.

PolicyStatesSummaryResourceType

Den virtuella resursen under PrincipTillstånd resurstyp för sammanfattningsåtgärd. I ett angivet tidsintervall representerar "senaste" de senaste principtillstånden och är det enda tillåtna värdet.

Name Typ Description
latest

string

QueryFailure

Felsvar.

Name Typ Description
error

Error

Feldefinition.

SummarizeResults

Sammanfatta åtgärdsresultat.

Name Typ Description
@odata.context

string

OData-kontextsträng; används av OData-klienter för att matcha typinformation baserat på metadata.

@odata.count

integer

Antal OData-entiteter; representerar antalet returnerade sammanfattningar. alltid inställd på 1.

value

Summary[]

Sammanfatta åtgärdsresultat.

Summary

Sammanfattningsresultat.

Name Typ Description
@odata.context

string

OData-kontextsträng; används av OData-klienter för att matcha typinformation baserat på metadata.

@odata.id

string

OData-entitets-ID; är alltid inställt på null eftersom sammanfattningar inte har något entitets-ID.

policyAssignments

PolicyAssignmentSummary[]

Sammanfattning av principtilldelningar.

results

SummaryResults

Efterlevnadssammanfattning för alla principtilldelningar.

SummaryResults

Efterlevnadssammanfattning på en viss sammanfattningsnivå.

Name Typ Description
nonCompliantPolicies

integer

Antal icke-kompatibla principer.

nonCompliantResources

integer

Antal icke-kompatibla resurser.

policyDetails

ComplianceDetail[]

Sammanfattning av principartefakt på den här nivån. För frågeomfångsnivå representerar den sammanfattning av principtilldelning. För principtilldelningsnivå representerar den sammanfattning av principdefinitioner.

policyGroupDetails

ComplianceDetail[]

Sammanfattning av principdefinitionsgruppen på den här nivån.

queryResultsUri

string

HTTP POST-URI för queryResults-åtgärd på Microsoft.PolicyInsights för att hämta råresultat för efterlevnadssammanfattningen. Den här egenskapen är inte tillgänglig som standard i framtida API-versioner, men kan efterfrågas uttryckligen.

resourceDetails

ComplianceDetail[]

Resurssammanfattningen på den här nivån.