I have a app service in Azure that has been scaled out to 5 instances. I can list the instances via the following az cli command
az webapp list-instances
But how can i tell which instance has frozen or is not responding and restart it ?
I have a app service in Azure that has been scaled out to 5 instances. I can list the instances via the following az cli command
az webapp list-instances
But how can i tell which instance has frozen or is not responding and restart it ?
2
Answers
With frozen/not responding I assume you speak about a web server that is not responding to HTTP requests (if you meant something else with frozen/not responding, please clarify in your answer above).
In this case Azure App Services can handle the restart itself when you configure a health check.
The URL you provided should return status 200 as long as the app is responsive.
Here is the Microsoft documentation: https://learn.microsoft.com/en-us/azure/app-service/monitor-instances-health-check?tabs=dotnet
UPDATE: A few comments on your questions, @Sarah:
testapp.azurewebsites.net/health
, you configure/health
/health
route should work without authentication. If you configure Authorization in the Azure Web app (e.g. in the Azure Portal again), Azure knows how to route the health check without authorizationHere is some powershell to call the REST API to fetch a list of instances, and call a health probe on each one: