Limit Resource Provider in Azure Policy

Yasmin, Fitri 266 Reputation points
2021-02-02T13:13:04.387+00:00

I tried to limit the allowed resource type based on their providers using Azure Policy. For example, I want to allowed all resources from Microsoft.Compute. The built-in 'Allowed resource types' is inefficient because I have to list all of possible resources, instead of simply putting the resource provider. This is the current state of my policy, which is not working because I only list the provider. Is there any way to make this works? As per my understanding I can not use 'Like' operators because I compare this to an array of allowed resource.![63082-2.jpg][1] [1]: /api/attachments/63082-2.jpg?platform=QnA

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
815 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 21,766 Reputation points MVP
    2021-02-02T14:19:21.96+00:00

    Hi,
    There is no way to make this policy to work with like. You will need to add each individual resource type. Best is to run some PS or CLI script that gathers the resource types for a provider so you can add them to your policy.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful