Search code examples
azureroutesazure-web-app-servicecanary-deployment

Azure App Service: Select the endpoint based on HTTP header value


I have a multi-tenant application where in each request, the tenant's ID is sent in the HTTP headers.

I would like to implement a simple canary deployment whereby I would pick a subset of the tenant IDs, create a deployment slot for the experimental version and route all HTTP requests for the selected tenants to the new slot.

That is, I need a way to inspect each request and, based on a value of an HTTP header, select the slot which should serve the request.

Is there a way to accomplish that with Azure App Services?


Solution

  • You'll need a reverse proxy which can be achieved using Proxy feature from Azure Functions.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-proxies

    However, the best way to implement it, is using API Management. As it's quite expesive, you can use the consumption plan which will save you a lot of money.

    https://learn.microsoft.com/en-us/azure/architecture/microservices/design/gateway