Setting up custom error pages in Azure App Gateway is a straightforward process that can be completed in a few steps. You can create a custom error page by uploading an HTML file to Azure Blob Storage.
To upload an HTML file to Azure Blob Storage, you'll need to create a new container and upload the file to it. This can be done through the Azure portal or using the Azure CLI.
The maximum size of the custom error page is 32KB. This is an important consideration when designing your custom error page, as it will be displayed to users in the event of an error.
By following these steps and best practices, you can create a professional and user-friendly custom error page that enhances the overall user experience of your Azure App Gateway application.
Configuration and Setup
To configure custom error pages in Azure App Gateway, you can define them at the Global or Listener level. The Global level applies to all listeners, but its configuration through the Azure portal is currently not supported.
You can set custom error pages at a Listener level for granular control, which gives you the ability to set error pages for applications served by that listener.
To set up custom error pages, you can follow these steps: Navigate to Application Gateway in the portal and choose the required resource.Select Listeners and navigate to a particular listener for which you want to specify an error page.Under Custom error pages section, specify publicly accessible URLs for the required status codes.Select Save.
Configuration Levels
Configuration levels are an essential aspect of setting up custom error pages in Application Gateway. You can define error pages at a Global or Listener level.
At a Global level, error pages are applied to all listeners of that application gateway. However, this configuration is not currently supported through the Azure portal.
On the other hand, Listener level gives you granular control to set error pages for applications served by that listener.
Here are the configuration levels in detail:
If you're using a combination of Global and Listener-level error pages for a gateway, you must explicitly mention the URLs for all desired response codes for that listener. A listener-specific configuration overrides all preceding global configurations applicable to that listener.
Portal Configuration
To configure a custom error page in the portal, navigate to Application Gateway and choose the required resource. Select Listeners and then navigate to a particular listener for which you want to specify an error page.
Under the Custom error pages section, specify publicly accessible URLs for the required status codes. Make sure to save your changes after configuring the custom error page.
To do this, follow these steps:
- Navigate to Application Gateway in the portal and choose the required resource.
- Select Listeners and navigate to a particular listener for which you want to specify an error page.
- Under Custom error pages section, specify publicly accessible URLs for the required status codes.
- Select Save.
Understanding Azure App Gateway Custom Error Pages
Azure App Gateway custom error pages can be configured to provide a better user experience, improving satisfaction and reducing bounce rates. This is especially important as users interact with applications, errors can occur due to various reasons, such as server downtime, incorrect URLs, or client-side issues.
Custom error pages can be designed to match your company's branding and visual identity, ensuring a consistent and cohesive user experience, even in the event of errors. Clear error messages can help users understand the nature of the problem without needing to contact customer support.
Azure Application Gateway is a layer 7 load balancer that enables us to manage and distribute traffic to our web applications. It was previously limited to setting up a personalized error page exclusively for two specific status codes: 502 — Bad Gateway and 403 — Forbidden. However, there has been a recent expansion in this capability, encompassing a selection of additional status codes that can now be accommodated with custom error pages.
Here are some of the additional status codes that can be supported with custom error pages:
To create a custom error page, you must have an HTTP response status code, the corresponding location for the error page, a publicly accessible Azure storage blob for the location, and an *.htm or *.html extension type.
Sources
- https://learn.microsoft.com/en-us/azure/application-gateway/custom-error
- https://stackoverflow.com/questions/68654960/how-to-set-a-custom-error-page-for-azure-application-gateway-403-page
- https://medium.com/@preetshahdevops/configuring-custom-error-pages-in-azure-application-gateway-39b9c876d916
- https://learn.microsoft.com/en-us/answers/questions/1333916/how-to-configure-a-custom-error-404-page-in-azure
- https://github.com/MicrosoftDocs/azure-docs/issues/91313
Featured Images: pexels.com