Hello @Callum
To set up a custom error message for your Azure Function App, you can use the Azure Portal to configure custom error pages. Here are the steps to follow:
- Navigate to your Azure Function App in the Azure Portal.
- Click on "Functions" in the left-hand menu.
- Click on "Configuration" in the top menu.
- Scroll down to the "Custom error pages" section and click "Add".
- In the "Status code" field, enter the HTTP status code you want to customize (e.g. 403 for access denied).
- In the "Path" field, enter the path to the custom error page you want to display (e.g. /errors/accessdenied.html).
- Click "OK" to save the custom error page configuration. Once you have set up the custom error page, any requests to your Azure Function App that result in the specified HTTP status code will display the custom error page instead of the default error message. In your case, you can create a custom error page for the
403 status code
and specify the path to the error page you want to display. You can then test this by accessing a resource that you do not have permission to access, such as the main site, and verifying that the custom error page is displayed.
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.