我们正在尝试找出如何使用 Azure Functions 拥抱无服务器,为全局的简单网站提供服务。 我们与美国、加拿大、德国和澳大利亚的人员合作。
据我所知,Azure Functions 会根据需要自动扩展。 但是,我们如何针对不同区域进行扩展?
编辑: 流量管理器似乎无法使用 Functions 来制定消费计划。
“使用无服务器架构,您只需为代码运行的时间付费。” (https://azure.microsoft.com/en-us/overview/serverless-computing/) 更改为标准应用程序服务计划后,情况不再如此。这也意味着我们也必须处理扩大自身规模的问题。
最佳答案
函数应用可以在 Azure 流量管理器后面运行。正如您所说,它们确实会自动扩展,但仅限于您创建它们的区域内。
要在全局范围内扩展它们,您需要:
在您关心的所有区域创建相同的功能应用
向所有人发布相同的内容
确保将给定功能的按键设置为相同
创建流量管理器地理映射配置文件(或性能)并 将其指向您的所有实例。 修改:您需要在流量管理器配置文件中使用外部端点。请参阅Nir's answer here
Hi,
You can setup an http Function as an external Traffic Manager endpoint (https://learn.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)
关于azure - 如何在全局范围内扩展 Azure Functions 以实现无服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45866175/