您如何针对无服务器在全球范围内扩展 Azure Functions?

How do you scale Azure Functions globally for Serverless?

我们正在尝试弄清楚如何使用 Azure Functions 来拥抱无服务器,以便在全球范围内为简单的网站提供服务。 我们与美国、加拿大、德国和澳大利亚的人一起工作。

我了解 Azure Functions 会根据需要自动扩展。 但是,我们如何针对不同地区进行扩展?

编辑: 流量管理器似乎无法使用 Functions 的消费计划。

"With serverless architecture, you only pay for the time your code is running." (https://azure.microsoft.com/en-us/overview/serverless-computing/) 更改为标准应用程序服务计划后,情况就不再如此。这也意味着我们也必须处理扩大自己的问题。

函数应用程序可以 运行 在 Azure 流量管理器后面。正如您所说,它们会自动扩展,但仅限于您创建它们的区域内。

要在全球范围内扩展它们,您需要:

  1. 在您关心的所有地区创建相同功能的应用程序

  2. 向所有人发布相同的内容

  3. 确保为给定功能设置相同的键

  4. 创建流量管理器地理映射配置文件(或性能)和 将它指向您的所有实例。 编辑:您需要在流量管理器配置文件中使用外部端点。参见 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)