I am updating my Azure App Service from Azure DevOps. Currently, my release is like this:
My question is whether it reasonable to stop the App Service during the update? When I select a release template from Azure DevOps for Azure App Service, there are't any stop/start steps, only the update step. So I am wondering if the stop/start is even needed?
You can start or stop multiple Azure App services together. You are familiar with the start, stop or restart an App Services from the App Service overview dashboard. This is fine as long as we are dealing with single App Service.
In the Azure portal, search for and select App services and select the app that you want to move. From the left menu, select Change App Service plan. In the App Service plan dropdown, select an existing plan to move the app to.
Each Plan can host multiple Web App, and stopping one Web App does not affect the billing for the Plan. To stop the billing, you have to either delete your App Hosting Plan or scale it down to Free.
Swapping into production—instead of deploying to production—prevents downtime and allows you to roll back the changes by swapping again.
There are (5) options for safe-deployment (atomic updates) to Azure Web Apps. Here is my preferred order ranked by priority and feature richness:
-enableRule:AppOffline
, or stop/start site to enforce atomicity)There are numerous other deployment options like cloud sync, github continuous, local git, etc - but they are all built upon Kudu APIs (as is Azure CLI).
Note: If you're using Azure DevOps - it's supports nearly all these options - leverage the Azure App Service Deploy task
What we have done mostly is:
Martin's suggestion on Take app offline is also a good one!
We prefer to deploy to slots and then swap so we incur minimal impact to production and can also rollback easily. Stopping/taking app offline can prevent file locking issues.
It probably depends on your app. If you don't have any issues when you just update your app (such as the a file is in use issue) you can consider to use the Take App Offline flag which will place an app_offline.htm file in the root directory of the App Service during the update (then it will be removed). This way user will recognize that something is happening with the app.
However, I often ended up doing the same like you: Stop, Update, Start 😉
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With