Quantcast
Channel: Azure Management Portal forum
Viewing all articles
Browse latest Browse all 4189

Custom policy in azure for avoiding Premium SSD managed disk

$
0
0

I am trying to write a policy to avoid Premium managed disk, for cost reasons, to specific subscription. Maybe this is not the right forum, if so, please direct me to the right one (which deals with policies).

I've tried some settings after looking at disk parameters, and it doesn't seem to work, meaning, although the policy is assigned to the subscription, it doesn't seem to work.

I've tried the following rule, after looking at the template for existing managed disks :

{
"if":{
"field":"Microsoft.Compute/virtualMachines/storageProfile.osDisk.managedDisk.storageAccountType",
"equals":"Premium_LRS"
},
"then":{
"effect":"deny"
}
}

 But it ain't working (meaning, it still let me create a virtual machine with managed premium SSD).

It should be quite easy to write this policy, but for some reason it doesn't work, and I couldn't find any docs explaining this hierarchy of resources, that I can write rules on.

Regards,

Meir


Viewing all articles
Browse latest Browse all 4189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>