Hello, @Prathamesh Padosakar !
How do I limit the number of VMs that are created?
First, there is a default subscription limit for the number of vCPUs available by VM size as well as by region:
You can check your current usage quickly using CLI or PowerShell (CLI shown below):
az vm list-usage --location "East US" -o table
Strict limits to the number of VMs are managed through RBAC, where only authorized individuals or entities responsible for maintaining the VM quota would be allowed to create VMs (either manually or through automation):
https://learn.microsoft.com/en-us/azure/role-based-access-control/overview
For additional monitoring, you can create budgets and alerts to ensure that you don't exceed budgets or project scope when deploying resources:
https://learn.microsoft.com/en-us/azure/well-architected/cost/monitor-alert
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-overview
I hope this helps, Prathamesh!
If this has been useful, please take a moment to accept answers as this helps increase visibility of this question for other members of the Microsoft Q&A community. If you still have questions, let us know in the comments. Thank you for helping to improve Microsoft Q&A!