0
votes

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.

1
Is the reply helpful?Nancy Xiong

1 Answers

0
votes

As far as I know, to handle the geo-traffic management, you could use Azure traffic manager with geographic traffic-routing method. You could choose to distribute traffic based on specific geographic locations per endpoint. The same location can't be specified in two endpoints.

In this case, what you need is to create three traffic manager profiles and multiple endpoints to distinguish the client's region. Traffic Manager uses the source IP address of the DNS query to determine the region from where a user is querying.

https://user-service.trafficmanager.net ---> endpoints 
{user-service-uk.azurewebsites.net, user-service-west-us.azurewebsites.net,...}

https://search-service.trafficmanager.net ---> endpoints 
{search-service-south-east-asia.azurewebsites.net, search-service-uk.azurewebsites.net,...}

https://product-service.trafficmanager.net ---> endpoints
{product-service-south-east-asia.azurewebsites.net,...}