1
votes

I have an instance of Azure API management and it`s working all right with one domain. My question is what is the best way to make this API available for multiple environments? For example my Urls are:

The four domain have the same web API running on them, they are just different servers. Do I create one API management instance for each one? Or do I create one instance in just one API management for each one?

Maybe there is an efficient way to do this and I`m missing out. Have a nice day.

Best Regards,

3

3 Answers

0
votes

I was needing this urgently so the way I did was importing and exporting the API. So basically I configured on the first server with all parameters I`d like, after this I went to the API page and exported to wadl and imported again changing the "Web API URL suffix" and "Web service URL".

The only cons I found is when I need to change the documentation or API definition, I need to change in four different API's. I`ll send this feedback to Microsoft and see their response.

Have a nice day.

0
votes

So the URLs you listed above are the backend services running Web API. If you use a single APIM instance then they will share the domain you set for that instance and can be delineated using suffixes - e.g. .azure-api.net/devapi, .azure-api.net/usapi, .azure-api.net/hkapi, etc. - the suffix names are under your control. Does that work / is it what you need?

0
votes

Although an old question, I was searching for a similar answer, so I thought I'd add the solution I used here. You can approach this by using the policies. In order to solve you first need to be able to differentiate which backend each user should be sent to (I used the products to do this, you might want to investigate using policies to do this part). Once you have the products on the single API, you can then use the 'Set backend service' to forward on each request to the correct environment for the user.

To edit the policies you can navigate to the page on the API management portal. Select the products and api that you wish to configure and then select configure policy. Insert the 'Set backend service' into the 'inbound' policy and insert the backend.

<set-backend-service base-url="https://example.co.uk"/>

This Microsoft page has some useful information on policies for redirecting https://azure.microsoft.com/en-gb/blog/policy-expressions-in-azure-api-management/