Custom Azure Policy to Limit VM's in Resource Group

Microsoft

We are looking for a way to limit the number of VM's that a resource group can create.  There is a policy built in where you can limit the type, but not the amount.  The goal is to create groups where students can create VM's, but we don't wan them to be able to create more than 10 new VM's in their resource group.  It looks like we could create a custom policy to do this, but wondering if anyone has done this before and can share the JSON code for that policy or if you can think of a better way to do it.  Thank you!

0 Replies