Using Azure Policy, what field will you use in the policy rule to apply a policy only to a specific resource type?

Experience Level: Junior
Tags: Azure Cloud Azure Policy

Answer

...
"allOf": [
  {
    "field": "type",
    "equals": "Microsoft.Resources/subscriptions/resourceGroups"
  }
]
...

The policy code above is not complete, however, it would make the policy to be applied only to resource groups.

Related Azure Cloud job interview questions
Azure Policy
Azure Policy

Are you learning Azure Cloud? Try our test we designed to help you progress faster.

Test yourself
AZ-104 Microsoft Azure Administrator Preparation
AZ-104 Microsoft Azure Administrator Preparation

Are you learning Azure Cloud? Try our test we designed to help you progress faster.

Test yourself