I'm trying to build a "maintenance mode" screen for Azure App Services running a single-page Vue app. Is this possible without Application Gateway?
I know Azure Application Gateway can serve up custom error pages, but we're currently not using this service and might have some legal/data privacy issues (it's a healthcare tool) with its data caching requirements.
I added a web.config
file to the wwwroot
on the service slot as an attempt to catch errors and redirect but it seems to have no impact. This is what I expected since Express should be handling routing and errors (which it does).
Asure has the ability to "stop a slot". Is there any way to customize the page that's displayed?
Other web searches show that custom errors were requested at one point, but the Azure feature request page produces a very beautiful 404 page (oh the irony).
Is there a way to customize the stopped
and/or server error pages in Azure? Are there other commonly accepted ways of solving a problem like this?
Custom Error page is only available by using the Application Gateway. This feature is not available Without Application Gateway. If you want this feature please add your feed back/Feature request here
You can catch the http errors only by using web.config
in wwwroot
directory by adding below code
< httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
< remove statusCode="404" subStatusCode="-1" />
< error statusCode="404" path="/public/CustomError.html" responseMode="ExecuteURL" />
< /httpErrors>
On above snippet of code can redirect to the CustomError.html if any html error occurred. Refer here