Is there any way to pass custom http headers as part of Azure Application Gateway backend health probe call? We need to pass a couple of custom headers in order for the health probe to work but unfortunately I have not been able to find any solution. Any help is highly appreciated.
-
have u created the `HttpHealthProbe` which can associate it with a backend pool by using the `BackendHttpSettings` object? – Sourav May 26 '23 at 12:29
-
yes I have done that – shaswata pal Jun 01 '23 at 11:05
1 Answers
You can create custom probe in the Azure Application Gateway backend health probe by specifying the headers in the HTTP settings associated with the probe.
Created Application gateway with backend pool and added routing rule like below;
To add a healthy probe, make sure to create a backend setting like below:
You can make use of custom health probe endpoint within your backend application that accepts the custom headers. you can add multiple health probes of your custom domain like below:
In the host you can also add virtual host contoso.com
private IP address of the server, or the public IP address, or the DNS entry of the public IP address When used with a file-based path entry, the probe will attempt to connect to the server and perform a health check by confirming a certain file is there on the server.
You can test and check the probes are in healthy state. Requests from the backend pool if probe identifies Unhealthy configured, Application Gateway won't forward requests to that server. You won't be able to access your application and it will receive an HTTP 502 error if there are no healthy resources in a backend pool.
Reference:
Create a custom probe using the portal - Azure Application Gateway | Microsoft Learn

- 3,875
- 2
- 3
- 12
-
Thanks for the response. However I am somehow not getting how to pass custom headers like content-type, or in my case where I need to send a custom header for Apollo GraphQL server called Apollo-Require-Preflight. I know I can change the host header using the description you provided above. Would be grateful to know if I am missing something here. – shaswata pal Jun 01 '23 at 11:01