4
votes

We're trying to figure out how to embrace serverless using Azure Functions to serve simple websites globally. We work with people in USA, Canada, Germany, and Australia.

I understand that Azure Functions scale up automatically as needed. But, how do we scale it out for different regions?

Edit: It seems Traffic Manager will not work on a consumption plan with Functions.

"With serverless architecture, you only pay for the time your code is running." (https://azure.microsoft.com/en-us/overview/serverless-computing/) Changing to a standard app service plan, this is no longer true. It also means we would have to deal with scaling up ourselves then too.

1

1 Answers

5
votes

Function apps can run behind Azure Traffic Manager. As you said they do scale up automatically, but only within the region you created them in.

To scale them globally, you'd need to:

  1. Create the same function app in all the regions you care about

  2. Publish the same content to all of them

  3. Make sure to set the keys to be the same for a given function

  4. Create a traffic manager geomapped profile (or performance) and point it to all your instances. Edit: you'll need to use External endpoint in your traffic manager profile. See Nir's answer here

Hi,

You can setup an http Function as an external Traffic Manager endpoint (https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-endpoint-types). However, you still have to deploy the Function to all the data centers you want them, give them unique names and deploy to each instance when you have a new version (that can be done from one GitHub \ VSTS account so it is not that bad). So to summarize, it is doable but requires some manual steps to setup. We will take this as a feature requirement though.

Thanks!

Nir (Functions team)