Reputation: 135
I have one AZURE Apim which is mapped to App service where I have deployed web API's(separate API for each customer). I have added an API URL prefix(Customer Name) in APIM endpoint so that I can define endpoints based on the customer as below. APIM URL: http://demoapim.com apim URL prefix : customer name(cust1, cust2) so now URL would be
http://demoapim.com/cust1 http://demoapim.com/cust2
web API endpoint: http://cutomerapi.com/details
When I am trying to access http://demoapim.com/cust2/details or http://demoapim.com/cust1/details, it gives 404.but http://demoapim.com/details works. Please help me what I am missing here.
Upvotes: 2
Views: 906
Reputation: 21883
After understanding apim, I have the following points, I hope it can be helpful to you.
No matter how many apim URL prefixes, cust1, cust2 and so on you have set. The final access address is /cust1/details
, the route of this address is not recognized in webapp services. So the problem now arises.
So I think the problem should not be in apim services, what you should pay attention to is your webapp services. You can rewrite the url or identify cust1 or cust2 for the access request and return the corresponding data.
URL Rewrite eg.
Your original URL:
http://demoapim.com/cust2-details
Final URL:
http://demoapim.com?cust=cust2&title=details
Using url rewrite in webapp services will better meet your business needs.
Upvotes: 1