@Oleksii Kovalchuk
Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to redirect traffic to a staging slot of Azure AppService behind Application Gateway based on Request Header.
Please note that, as of now, Application gateway offers two ways for redirection,
- Listener Redirection
- Path-based Redirection to a different backend Pool
- Redirection to External Site
Also, you cannot add a staging slot as the backend Pool of an AppGw
- This means, you will have to use the IPAddress/FQDN of the staging slot instead of AppService in AppGw backend settings
- This also means that you have to manage the BackendSettings such as HostName, Probe and certificates incase of End-to-End TLS.
At this stage, I hope you can arrive at the complexity of the requirement.
The requirement is doable, but it will
- Require you to use Path-based routing, instead of Header-based routing or use a different URL and Listener altogether for the Staging environment's traffic
- For e.g., "/" ---> goes to default backend and "/staging/*" ---> goes to Staging backend.
-
![User's image](https://learn-attachment.microsoft.com/api/attachments/a51dd462-5f70-458e-8aad-7e5c5f79f231?platform=QnA)
- URL path-based redirection
Now, for the HTTPSettings,
I hope I was able to summarize the key requirements and constraints related to this set-up.
Let us know should you have any additional queries.
Cheers,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members :)