Search code examples
azureroutesmulti-tenantazure-api-managementapi-gateway

Azure API gateway reroute urls based on tenant Id to backend application which are not hosted on Azure?


I have following requirement.

Currently we have different back-end public facing API applications(Not in Azure) for each tenant. We are building a mobile application. for that we have come up with an integration layer where we invoke multiple API's from our Back-end API applications using Azure Logic Apps.

This Logic APP url's further will be integrated with API Management.

But we are looking for the possibility to reroute the request to relevant back-end api application based on tenant id which we pass as query string parameter.

Can any one please help me to understand whether Azure API gateway supports urls rerouting to external public facing applications (Backed applications are Not in Azure) ?

We are planning to move back-end applications to AZURE but not near by. Mean while we wanted to have a solution.

Currently we are storing the Host name and Tenant ID in Table storage. So based on tenant id we are fetching the host name and forming the URL with relevant host name.

Any other alternative ideas are also highly appreciable.If you need any other information please let me know?


Solution

  • I believe the approach you are taking is the right one. The same in APIM can be achieved by using the set-backend-service policy.

    You could either fetch the hostname from table storage in APIM using the send-request policy (cache the result for better latency).

    Or you can use Named Values to store the mappings and remove table storage altogether.