Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stopping or Disabling a resource group in Azure

Tags:

azure

Is there any way to disable or stop a particular resource group temporarily? I know we can delete the resource group or we can stop certain services under the resource group but I am unable to find a way where I can just shut down the resource group or all of it's resources at once, temporarily.

Please let me know if I can provide few more details about this.

Thanks.

like image 359
Display name Avatar asked Apr 03 '18 10:04

Display name


2 Answers

This does not seem to be possible at the moment but a request has been made here, however, no response from Microsoft on what it's status.

In general, if there are features that are not available in e.g. Azure, use the feedback site to suggest and vote on new features.

However, if you only got some specific type of resources in your resource group, like e.g. virtual machines, then you can stop them all in one PowerShell command like this:

Get-AzureRmResourceGroup <group name> | Stop-AzureRmVM -Force

Note: this approach is highly dependent on the type of resource and not a generic solutions like requested

like image 142
kim Avatar answered Oct 19 '22 19:10

kim


A resource group is just a bounding-box, serving as a grouping mechanism and a security boundary. You cannot "stop" a resource group, as a resource group is never running. Yes, you can delete a resource group (along with everything in it), but that's a one-shot operation. It's not a fine-grained resource-management operation.

As for the services inside a resource group: some can be stopped, some cannot. For instance, you cannot stop a storage account. Others have very different behaviors when stopped: A VM simply sleeps/hibernates until restarted with everything preserved, while an HDInsight cluster, when stopped, deletes everything.

TL;DR there is currently no way to point to a resource group and have it stop all of its services, given the variability of behavior (and the fact there's no such supported API). You'll need to manage your resource starts/stops.

like image 37
David Makogon Avatar answered Oct 19 '22 20:10

David Makogon