How enable support ID in Azure application Gateway

New Contributor


I want to enable/include support ID in the default custom page error of Azure application Gateway. 

we are using azure app gateway with azure WAF and many requests are being blocked as it match waf signatures, when the request is blocked users promoted with 403 forbidden page and we are finding hard time to trace the user request in the logs as we don't have much information of the blocked session.

in other vendors such as F5 WAF / Barracuda when the request is blocked user/client is prompted with a  support id which is easy for us to track the log by the given support ID. 

is there any similar solution of the above issue 

1 Reply
Yes, you can include a support ID in the default custom error page of your Azure Application Gateway to help trace blocked requests in the logs.

Here are the steps to enable/include a support ID in the default custom error page:

1. Create a custom error page with the support ID information you want to include.
2. Upload the custom error page to Azure Blob Storage.
3. Configure the Azure Application Gateway to use the custom error page as the default error page.
4. Use Azure Application Insights to log the support ID for each blocked request.
To configure Azure Application Insights to log the support ID, you can add a custom field to the telemetry data using the following code:
TelemetryClient telemetryClient = new TelemetryClient();
telemetryClient.Context.Cloud.RoleInstance = "Application Gateway";
telemetryClient.Context.Cloud.RoleName = "Application Gateway";
telemetryClient.Context.Operation.Id = HttpContext.Current.TraceIdentifier;
telemetryClient.Context.Operation.Name = "Blocked Request";
telemetryClient.Context.User.Id = "Support ID";
telemetryClient.TrackEvent("Blocked Request");