Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)
I have created a Azure policy that will validate for the region of resource groups. But even if I deploy any resource in the resource group it return "Resource Not Found". Can anyone help me with the policy and assignment?

1 Answer

0 votes
by (26.7k points)

Basically, we need to put some restriction on the type field, also we need to determine some field which should be excluded like:

"policyRule": {

  "if": {

    "allOf": [

      {

        "field": "location",

        "notIn": "[parameters('listOfAllowedLocations')]"

      },

      {

        "field": "location",

        "notEquals": "global"

      },

      {

        "field": "type",

        "notEquals": "Microsoft.AzureActiveDirectory/b2cDirectories"

      }

    ]

  },

I hope this will help.

Want to become an Azure Expert? Join Azure Developer Certification now!!

Browse Categories

...