I have an App Service which is running on multiple instances and also has a CI/CD set, so WebJobs isn’t really an option here. I’ve found an elegant solution with a Logic App and Azure API but I was only able to schedule a restart of the whole App Service. This works fine, but it will cause some downtime. I would like to restart instances one by one using the same Logic App + API approach to decrease the downtime.
2
Answers
I was able to set the Logic App to iterate through all App Service instances and reboot workers in the App Service Plan one by one, using a suggestion from @VenkateshDodda
Create an App Registration and obtain a Client Secret.
Grant permissions for user_impersonation in Azure Service Management -> API permissions inside your App Registration
Grant permissions for your App Registration in the App Service Plan and App Service under Access Control.
Paste the attached complete code into your Logic App.
Modify it with your client_secret, tenant_id, subscription_id, resourceGroup, appServicePlan, appServiceName, etc:
}
Unfortunately,we dont have any default action that can you help you in restarting the app service scaled-out instances one-by-one.
You need to create a custom logic app and by calling the below Azure Management Rest API’s using
HTTP
actions.