I have several services in some Azure Resource Groups, today I have to stop one by one when needed! Is it possible to stop all at once?
I have several services in some Azure Resource Groups, today I have to stop one by one when needed! Is it possible to stop all at once?
No, you do not have this functionality the way you look. This is because it is not every service that has the "Stop" option. The only thing that can be done in a batch is to delete a Resouce Group - which helps a lot.
But you can use Azure bash with CLI to make it pretty simple. Here's an example of how to start, stop, and deallocate VMs.
# example usage
az vm start --ids $(
az vm list --query "[].id"
-o tsv | grep "Test"
)
az vm stop --ids $(
az vm list --query "[].id"
-o tsv | grep "Test"
)
az vm deallocate --ids $(
az vm list --query "[].id"
-o tsv | grep "Test"
)
Source: link