Stop all services in Azure

Asked

Viewed 87 times

1

I have several services in some Resource Groups in Azure, today I have to stop one by one when needed! It is possible to stop all at once?

1 answer

1

No, it does not have this functionality the way you look for it. This pq is not every service that has the "Stop" option. The only thing you can do in batches is to delete an entire Resouce Group - which already helps a lot.

But, you can use Azure bash with CLI to make it very simple. Here’s an example of how to start, stop and de-locate 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: https://buildazure.com/2017/06/07/azure-cli-2-0-quickly-start-stop-all-vms/

  • You can do the same scheme you did with VM for Web App’s?

  • No, because the command az webapp stop does not accept array of ids. But I confess that I do not see much sense in it, because you would stop all webapps of a Source group?

  • I want to stop all services because it has already reached my credit limit and I don’t want to leave it on, but then you talk, Azure has a lock for that, yes, it does. But I took the lock because I want to test my APP after turn everything off, then turn it on again when testing, understood?

  • I just wanted a way to turn everything off while not using to not keep accounting.

  • Webapp does not stop counting, even stopped.

  • Got it, if I stop the VM’s at least stop counting? In this command above I don’t lose them right? As I understand it, webapp’s don’t spend much, but VM’s seem to.

  • 1

    Stop VM only accounts for Storage, but computing time does not.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.