{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/site-offline-503-azure","result":{"data":{"markdownRemark":{"html":"<p>One of our projects use <a href=\"https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots\">Azure App Service Deployment Slots</a>. We push changes through a Jenkins pipeline. Each deployment does what seems to be a standard \"diff\" deployment - pushing only the files that have changed in the recent build compared to what is on the AppService (I believe relying on <code class=\"language-text\">SkipExtraFilesOnServer</code> params for WebDeploy). </p>\n<p>In other words, if you have a file that is only available on your AppService box the deployment push is going to leave it there.</p>\n<p>When a deployment slot is used to swap two AppService instances when serving an app, it appears as if the underlying process Azure uses places a file called \"app_offline.html\" in the root directory of the AppService as it does it's thing. Once done, the file is removed (<a href=\"https://github.com/Azure/app-service-announcements/issues/137\">that seems to be the idea</a>, anyways, but causes some troubles elsewhere, too). </p>\n<p>The existence of <code class=\"language-text\">app_offline.html</code> in a root directory of a website seems to force an AppService to always return that file to whatever request the app is receiving. It's a shortcut method of putting your site offline for whatever reason. Definitely useful. </p>\n<p>The glitch comes when CI/CD deployment does that \"diff\" deployment to preserve bandwidth/amount of files pushed to Azure and leaves unique files on the box. Occasionally, swapping a deployment slot does not succeed and in such cases, there's a chance that an app_offline.html file might be left there unintentionally. </p>\n<p>If you keep seeing <code class=\"language-text\">503 Service Unavailable</code> responses to <strong>whatever</strong> requests are issued at the AppService, chances are that the AppService has <code class=\"language-text\">app_offline.html</code> in the root. Remove it (open <strong>App Service Editor (Preview) > Go</strong> for your AppService in Azure portal and find the file in the left sidebar and <strong>right-click > Delete</strong>) and things should go back to normal. </p>\n<p><strong>Resources</strong></p>\n<p><span style=\"font-size:small\">1. <a href=\"https://docs.microsoft.com/en-ca/azure/azure-functions/deployment-zip-push\">Azure ZIP deployments</a></span></p>","excerpt":"One of our projects use Azure App Service Deployment Slots. We push changes through a Jenkins pipeline. Each deployment does what seems to be a standard \"diff…","frontmatter":{"date":"18 January, 2020","path":"/blog/site-offline-503-azure","title":"Azure AppService returns 503 Service Unavailable"},"fields":{"readingTime":{"text":"2 min read"}}}},"pageContext":{}}}