Partager via


Policy States - Summarize For Subscription

Récapitule les états de stratégie pour les ressources sous l’abonnement.

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}

Paramètres URI

Nom Dans Obligatoire Type Description
policyStatesSummaryResource
path True

PolicyStatesSummaryResourceType

Ressource virtuelle sous Type de ressource PolicyStates pour l’action de synthèse. Dans un intervalle de temps donné, « latest » représente le ou les états de stratégie les plus récents et est la seule valeur autorisée.

subscriptionId
path True

string

ID d’abonnement Microsoft Azure.

api-version
query True

string

Version de l’API cliente.

$filter
query

string

Expression de filtre OData.

$from
query

string

date-time

Horodatage au format ISO 8601 spécifiant l’heure de début de l’intervalle à interroger. Lorsqu’il n’est pas spécifié, le service utilise ($to - 1 jour).

$to
query

string

date-time

Horodatage au format ISO 8601 spécifiant l’heure de fin de l’intervalle à interroger. Lorsqu’il n’est pas spécifié, le service utilise l’heure de la requête.

$top
query

integer

int32

Nombre maximal d’enregistrements à retourner.

Réponses

Nom Type Description
200 OK

SummarizeResults

Résumez les résultats.

Other Status Codes

QueryFailure

Réponse d’erreur décrivant la raison de l’échec de l’opération.

Sécurité

azure_auth

Flux OAuth2 Azure Active Directory

Type: oauth2
Flux: implicit
URL d’autorisation: https://login.microsoftonline.com/common/oauth2/authorize

Étendues

Nom Description
user_impersonation Emprunter l’identité de votre compte d’utilisateur

Exemples

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

Summarize at subscription scope

Exemple de requête

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

Exemple de réponse

{
  "@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

Exemple de requête

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

Exemple de réponse

{
  "@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
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}

Définitions

Nom Description
ComplianceDetail

Cumul de l’état de conformité.

Error

Définition de l’erreur.

PolicyAssignmentSummary

Résumé de l’affectation de stratégie.

PolicyDefinitionSummary

Résumé de la définition de stratégie.

PolicyGroupSummary

Résumé du groupe de définitions de stratégie.

PolicyStatesSummaryResourceType

Ressource virtuelle sous Type de ressource PolicyStates pour l’action de synthèse. Dans un intervalle de temps donné, « latest » représente le ou les états de stratégie les plus récents et est la seule valeur autorisée.

QueryFailure

Réponse d’erreur.

SummarizeResults

Résumer les résultats de l’action.

Summary

Résultats récapitulatives.

SummaryResults

Résumé de la conformité à un niveau de résumé particulier.

ComplianceDetail

Cumul de l’état de conformité.

Nom Type Description
complianceState

string

État de conformité.

count

integer

Valeur du nombre résumé pour cet état de conformité.

Error

Définition de l’erreur.

Nom Type Description
code

string

Code d’erreur spécifique au service qui sert de sous-état pour le code d’erreur HTTP.

message

string

Description de l'erreur.

PolicyAssignmentSummary

Résumé de l’affectation de stratégie.

Nom Type Description
policyAssignmentId

string

ID d’affectation de stratégie.

policyDefinitions

PolicyDefinitionSummary[]

Résumé des définitions de stratégie.

policyGroups

PolicyGroupSummary[]

Résumé du groupe de définitions de stratégie.

policySetDefinitionId

string

ID de définition de jeu de stratégies, si l’attribution de stratégie concerne un ensemble de stratégies.

results

SummaryResults

Résumé de la conformité pour l’attribution de stratégie.

PolicyDefinitionSummary

Résumé de la définition de stratégie.

Nom Type Description
effect

string

Effet de stratégie, c’est-à-dire action de définition de stratégie.

policyDefinitionGroupNames

string[]

Noms de groupes de définition de stratégie.

policyDefinitionId

string

ID de définition de stratégie.

policyDefinitionReferenceId

string

ID de référence de définition de stratégie.

results

SummaryResults

Résumé de la conformité pour la définition de stratégie.

PolicyGroupSummary

Résumé du groupe de définitions de stratégie.

Nom Type Description
policyGroupName

string

Nom du groupe de stratégies.

results

SummaryResults

Résumé de la conformité pour le groupe de définitions de stratégie.

PolicyStatesSummaryResourceType

Ressource virtuelle sous Type de ressource PolicyStates pour l’action de synthèse. Dans un intervalle de temps donné, « latest » représente le ou les états de stratégie les plus récents et est la seule valeur autorisée.

Nom Type Description
latest

string

QueryFailure

Réponse d’erreur.

Nom Type Description
error

Error

Définition de l’erreur.

SummarizeResults

Résumer les résultats de l’action.

Nom Type Description
@odata.context

string

Chaîne de contexte OData ; utilisé par les clients OData pour résoudre les informations de type en fonction des métadonnées.

@odata.count

integer

Nombre d’entités OData ; représente le nombre de résumés retournés ; toujours défini sur 1.

value

Summary[]

Résumer les résultats de l’action.

Summary

Résultats récapitulatives.

Nom Type Description
@odata.context

string

Chaîne de contexte OData ; utilisé par les clients OData pour résoudre les informations de type en fonction des métadonnées.

@odata.id

string

ID d’entité OData ; toujours défini sur null, car les résumés n’ont pas d’ID d’entité.

policyAssignments

PolicyAssignmentSummary[]

Résumé des affectations de stratégie.

results

SummaryResults

Résumé de la conformité pour toutes les attributions de stratégie.

SummaryResults

Résumé de la conformité à un niveau de résumé particulier.

Nom Type Description
nonCompliantPolicies

integer

Nombre de stratégies non conformes.

nonCompliantResources

integer

Nombre de ressources non conformes.

policyDetails

ComplianceDetail[]

Résumé de l’artefact de stratégie à ce niveau. Pour le niveau d’étendue de la requête, il représente le résumé de l’affectation de stratégie. Pour le niveau d’affectation de stratégie, il représente le résumé des définitions de stratégie.

policyGroupDetails

ComplianceDetail[]

Résumé du groupe de définition de stratégie à ce niveau.

queryResultsUri

string

URI HTTP POST pour l’action queryResults sur Microsoft.PolicyInsights pour récupérer les résultats bruts du résumé de conformité. Cette propriété ne sera pas disponible par défaut dans les versions futures de l’API, mais peut être interrogée explicitement.

resourceDetails

ComplianceDetail[]

Résumé des ressources à ce niveau.