Is it possible to inject a custom request header in the request header of my service using Application Gateway Rewrites?

Ranjithukumar 0 Reputation points
2024-02-19T18:06:05.46+00:00

How can I add a custom request header using Application Gateway Rewrites? I want to inject the header in the request header of my service. I tried adding a request header with a custom value, but it wasn't visible in the request info, whereas a response header worked. We are currently using an nginx service that runs inside a VM as the backend pool. Can anyone provide any assistance on how to accomplish this?

Rewrite set for custom request header

We could not find in this Request header.

Browser request header of our service

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,467 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,075 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
445 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Priya Kumar 1,096 Reputation points Microsoft Employee
    2024-02-20T04:38:50.0333333+00:00

    Hello @Ranjithukumar ,

    Thanks for reaching out to Microsoft Q and A platform.

    Could you please provide the information on where do you see that the request header not seen?

    The request header is set post Application Gateway forward the request to the backend VM's.

    Could you please take a fiddler behind the VM, to find out the request header? The response would be seen on the Client machine. But changes to the Request Header would be seen behind the application gateway.

    Any application-level logs would also help to track the Http request.

    https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#rewrite-actions

    Regards, Priya Kumar

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.