Forum Discussion
gyosko
May 01, 2023Copper Contributor
How enable support ID in Azure application Gateway
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...
Makenx2022
May 01, 2023Copper Contributor
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");
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");