Manually setting app_offline.htm in Azure App Service deployment

Hi Support,

I’d like to be able to take my Azure App Service app offline prior to running my “Deploy Web App” step. Previously, I’ve been using the Enable AppOffline option in this step, however I’d like to be able to do this manually in an earlier step under certain circumstances.

I’ve seen that I can also use Azure RM to call Stop-AzureRmWebApp, however I’d quite like to be able to set my own app_offline.htm file if possible. So I’m wondering what the best way for me to upload a single app_offline.htm file to take the app offline with a custom page. Then I have some steps to carry out prior to Deploy Web App which will re-start the app.

Paul

Hi Paul,

Thanks for getting in touch and sorry for the late reply.

You could achieve this by having a package that only contains your app.offline.htm file, and conditionally run a deployment step that deploys this package whenever you need it. This way you don’t have to mess around with Azure RM cmdlets, as this would be just another deployment step in your process.

You could even enable pre-deployment scripts in your deployment step to modify some of the content of your app_offline,htm file using some powershell for extra customization.

Let me know if this helps.
Dalmiro

Dalmiro,

thanks for your reply. I’ve created a step which deploys a package containing only a single app_offline.htm file. This works great, and takes the app offline showing a custom page.

However! My proper Deploy Web App step runs later and even though I’ve checked the box to Enable AppOffline, it doesn’t seem to remove the file after the deployment is finished, so the app never comes online again. By the way, I’m including app_offline.htm in my main package too to prevent a default blank page being shown in this step.

By the way, I’m not sure if this is correct or connected, but the UI says: “Select to safely bring down the app domain with app_offline.html in root” wheras my understanding is that it must be called .htm not .html?

I’ve created a step which deploys a package containing only a single app_offline.htm file. This works great, and takes the app offline showing a custom page.

Cool! one thing off the plate then :slight_smile:

However! My proper Deploy Web App step runs later and even though I’ve checked the box to Enable AppOffline, it doesn’t seem to remove the file after the deployment is finished, so the app never comes online again. By the way, I’m including app_offline.htm in my main package too to prevent a default blank page being shown in this step.

Is there a chance you get Get the raw log from your deployment and send it to me to support@Octopus.com so I can check this out?

By the way, I’m not sure if this is correct or connected, but the UI says: “Select to safely bring down the app domain with app_offline.html in root” wheras my understanding is that it must be called .htm not .html?

If I recall correctly, .html should also work. But yeah every single Microsoft documentation mentions it as .htm, so I’ll quickly change that in the UI so it looks more accurate. Thanks for noticing it!

Cheers,
Dalmiro