How to Stop and Restart WebApp in Azure Cloud Shell

Websites can go down for a number of reasons but there is a common first troubleshooting technique that resolves issues more times than you think. Stopping and restarting a webapp in azure is a quick and simple process. Below you will find the commands to fix a broken site.

Account List:
az account list –output table

List all resource groups in subscription:
az group list –output table

List Resources in Certain Groups:
az resource list \
–resource-group Learn-4a63238b-ed3e-4a52-b37a-83a19493580f \
–resource-type Microsoft.Web/sites

(–resource-type allows us to specify and filter on groups related to websites)

 

How to STOP a resource (webapp):

az webapp stop \
–resource-group Learn-4a63238b-ed3e-4a52-b37a-83a19493580f \
–name <nameofresource>

 

How to START a Resource (webapp):

az webapp start \
–resource-group Learn-4a63238b-ed3e-4a52-b37a-83a19493580f \
–name <web app name>

Check you domain in a browser and verify that services have been restored.

 

Posted in Azure, Microsoft and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *