Search code examples
azureazure-cli

trigger compliance scan in Azure policies from CLI


I used the 'Start-AzPolicyComplianceScan' from the PowerShell to trigger a compliance scan for the policies assigned. what is the equivalent command to trigger a compliance scan on the policies from the Azure CLI tool?


Solution

  • What is the equivalent command to trigger a compliance scan on the policies from the Azure CLI tool?

    You can use the below Azure CLI cmdlet to trigger a compliance scan on the policies at the current subscription scope.

    az policy state trigger-scan

    Or use the below cmdlet to trigger a policy compliance evaluation for your resource group:

    az policy state trigger-scan -g "myRg"