Lets say we have a list of microservices based on Azure FnApps - user-service, search-service, product-service etc... Each of the service is deployed gobally. Eg :
user-service-uk.azurewebsites.net
user-service-west-us.azurewebsites.net
search-service-south-east-asia.azurewebsites.net
search-service-uk.azurewebsites.net
search-service-east-us.azurewebsites.net
..... ETC
We have an APIM interface wrapping all the api-operations and performing AuthZ & AuthN. So this cannot be removed or replaced.
myapis.azure-apis.net/user
myapis.azure-apis.net/search
myapis.azure-apis.net/product
What is the best way to do geo-traffic management in this scenario.
Our current approach is using APIM policies.
<choose>
<when condition="@("West US".Equals(context.Deployment.Region, StringComparison.OrdinalIgnoreCase))">
<set-backend-service base-url="http://user-service-west-us.azurewebsites.net/" />
</when>
<when condition="@("South East Asia".Equals(context.Deployment.Region, StringComparison.OrdinalIgnoreCase))">
<set-backend-service base-url="http://user-service-south-east-asia.azurewebsites.net/" />
</when>
<otherwise>
<set-backend-service base-url="https://user-service-west-us.azurewebsites.net" />
</otherwise>
</choose>
But with more micro-services growing and our app venturing into more regions, we are facing maintainence nightmare for the policies.
We explored Azure Front Door, but the URL Rewrite doesn't let us carry the suffix of the pattern matched.
Eg:
For the url, https:myapi.azure-afd.net/user
Is there a way to set up the Routing-Tab's URLRewrite
when the url matches with /user/*
Custom Rewrite
to /*
(meaning entire url-suffix except /user
)
PS:
An alternate approch we thought of is creating one Azure Traffic Manager profile per microservice Eg:
https://user-service.trafficmanager.net
https://search-service.trafficmanager.net
https://product-service.trafficmanager.net
However, with 100+ new microservices coming in, we would end-up in a burst of ATM profiles.