This is the scenario:
|-> Backend #1 (Function App)
APIM-> |-> Backend #3 (Function App)
|-> Backend #n (Function App)
I’m currently building a deployment pipeline that will:
- Have Terraform deploy our API operations to Azure API Management and configure their corresponding products, respective subscription keys, and set-backend policies
- afterward, run the funcapp publish CLI (Azure Function Core Tools) to deploy the Function App code since they are the actual backends
- confirm that the deployed backend is operational via a curl request to the API endpoint using that particular product’s subscription key
Everything is working fine so far. The only issue I’m struggling with at the moment regards to step #3 above: how can I ensure that the API response I’m getting is indeed coming from the recently deployed backend (since there are many)?
Is there a way from an API Management policy to retrieve the backend hostname (Host
header?) and somehow expose it to the client?
Or maybe some other cleverer and more secure way to do it?