skip to Main Content

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.

webapp stack on Az

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: error pages setup

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.error ages setup on other webapp

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


  1. Chosen as BEST ANSWER

    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.


  2. 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.

     <error-page>
        <error-code>500</error-code>
        <location>/error.html</location>
     </error-page>
     <error-page>
        <error-code>404</error-code>
        <location>/file_not_found.html</location>
     </error-page>
    
    • 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 and error.html) exist in the appropriate location within the web application.

    MyWebApp/
    ├── src/
    │   └── main/
    │       ├── java/
    │       │   └── com/
    │       │       └── example/
    │       │           └── mywebapp/
    │       │               └── App.java
    │       ├── resources/
    │       └── webapp/
    │           ├── WEB-INF/
    │           │   ├── web.xml
    │           └── error_pages/
    │               ├── file_not_found.html
    │               └── error.html
    └── pom.xml
    
    • Here I have tested the application by triggering 404 and 500 errors to check that the custom error pages are being displayed correctly.

    enter image description here

    If budget is the issue, you can Auto/manual scale your instance.

    enter image description here

    To Downgrade your plan, Go to Scale up(app service).

    enter image description here

    • There was a clear document on this please check here for more insights. If it doesn’t work, please recheck your configuration and add more detail to your original question.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search