'Azure Policy Definition to prohibit creation of a VM above certain cost per month?
Is there a way to define a policy in an Azure subscription that will block the creation of any virtual machine with a cost above a certain amount? I have tried defining a policy that whitelists or blacklists individual SKU's, but it's tedious to maintain, to say the least.
Solution 1:[1]
Is there a way to define a policy in an Azure subscription that will block the creation of any virtual machine with a cost above a certain amount?
In Azure Policy, there are several built-in policies that are available by default. For example:
- Allowed Storage Account SKUs
- Allowed Resource Type
- Allowed Locations
- Allowed Virtual Machine SKUs
- Add a tag to resources
- Not allowed resource types
And the below are the recommended policies for VM's:

You can Create a Custom policy definition that allows to define their own rules for using Azure like below:
Example:
Each storage account must be enabled for HTTPS
Each storage account must be disabled for HTTP.
Refer this link for more info about creating custom policies.
But there is no way to define a policy in an Azure subscription that will block the creation of any virtual machine with a cost above a certain amount.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RajkumarMamidiChettu-MT |
