Policy States - Trigger Subscription Evaluation

Triggers a policy evaluation scan for all the resources under the subscription

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2024-10-01

URI Parameters

Name In Required Type Description
subscriptionId
path True

string (uuid)

minLength: 1

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

The request has succeeded.

202 Accepted

The scan was successfully triggered.

Headers

  • Location: string
  • Retry-After: integer
Other Status Codes

PolicyInsightsCommon.QueryFailure

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Trigger evaluations for all resources in a subscription

Sample request

POST https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2024-10-01

Sample response

Code: 202
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.PolicyInsights/asyncOperationResults/00000000-0000-0000-0000-000000000000?api-version=2024-10-01
Message: Accepted
Retry-After: 30

Definitions

Name Description
PolicyInsightsCommon.QueryFailure

Error response.

PolicyInsightsCommon.QueryFailureError

Error definition.

PolicyInsightsCommon.QueryFailure

Error response.

Name Type Description
error

PolicyInsightsCommon.QueryFailureError

Error definition.

PolicyInsightsCommon.QueryFailureError

Error definition.

Name Type Description
code

string

Service specific error code which serves as the substatus for the HTTP error code.

message

string

Description of the error.