I have a Tomcat 9 based app service on Azure (see my stack attached) that has an in-out of season usage pattern and I need to swtich it to a lower app service plan for the summer.
The app has been running perfectly on a B3 sku plan until season started, when it was switched to a P1V3. So far so good.
Now I want to switch it back to B3 for the ‘hibernation’ period because it’s more than 50% cheaper and more than enough for the hibernation requirements. Cost-cutting at it’s most common sense.
However Azure does not allow it with the message "
The target sku (‘Basic’) does not support CustomErrorPages, please delete all custom error pages before making this change."
The error pages setup in Az is as following:
I cannot remove these 3 entries, which have also appeared on another already running B3 webapp, using same stack, with no custom error pages, and on which Az is urging me to upgrade to a premium plan (see below). Which I most certainly do not need or want to.
I have tried to set and remove the custom error pages, hoping that some default was assumed at some point and I wanted to make the dis-configuration/removal of the custom error pages explicit.
I’ve been searching the ‘net for a week now for a solution to now avail, copilot says of a solution that applies only to ASP.NET based webapps. Meanwhile the costs are adding up for nothing, my webapp is mostly idle, but I need to keep it going for the users to be able to access their account data until season starts again.
What am I missing?
2
Answers
Eventually I ended up reinstalling the app on B3 migrating into the new webapp all necesary resources, switched DNS to the new instance once started, then stopped the previous one, which I kept stopped for a few more days untill I noticed that it still incurs costs, after which I deleted it along with it's ASP. Costs reduced by more than half now during off-season.
I would still like to understand why Az concluded that my app used custom error pages even if I am convinced that it didn't, which prevented a simple scale-down operation, and also what could I have done to make this change without the hassle of migrating everything into new webapp and ASP instances.
Since the B3 plan does not support Azure portal-defined custom error pages as it need premium plan, configure custom error pages directly within the Tomcat application by editing the
web.xml
file. This approach will work independently of the Azure App Service plan.Add these lines to the web.xml configuration file that redirects all the Tomcat 404 errors to the defined page.
The custom error pages (
file_not_found.html
anderror.html
) exist in the appropriate location within the web application.If budget is the issue, you can Auto/manual scale your instance.
To Downgrade your plan, Go to
Scale up(app service)
.