如何部署具有不同参数的Azure函数的多个副本 [英] How can I deploy multiple copies of an Azure function with different parameters

查看:60
本文介绍了如何部署具有不同参数的Azure函数的多个副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在运行Azure函数,以定期从REST API中提取数据并将数据复制到一组文件中.它工作正常,但目前已设计为可迭代100个不同的参数.理想情况下,负载将是独立的.有没有办法为每个实例使用不同的静态参数多次部署Azure功能?

I am currently running an Azure function to periodically pull data from a REST API and copy the data to a set of files. It works fine but is currently architected to iterate through 100 different parameters. Ideally the loads would be independent. Is there any way of deploying an Azure function multiple times with a different static parameter for each instance?

谢谢

推荐答案

一种可能的解决方案是,如果要保留当前的体系结构,则使用应用程序设置存储参数.

One possible solution is to use Application Settings to store your parameters if you want to keep your current architecture.

  • Create ARM template to provision your azure function with parameters in app settings (you can use arrays in ARM templates https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-multiple). So in your case, it will create App1, App2, App3 ... each one will have a static parameter specified by the value in ARM template.
  • Use Powershell to deploy your app to each function app. (Something like this should be fine https://blogs.msdn.microsoft.com/benjaminperkins/2016/10/01/deploy-an-app-service-using-azure-powershell-to-a-deployment-slot/). Or perhaps, I guess you can do the entire thing with Powershell.

如果可以更改您的体系结构,在这种情况下,我将使用耐用功能,它支持Fan In/Out体系结构(

If I could change your architecture, I would use Durable Functions in this case, it supports Fan In/Out architecture (https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-cloud-backup). So for each request, it will spawn 100 different functions with different parameters as well.

让我知道您是否还需要其他东西.

Let me know if you need anything else.

这篇关于如何部署具有不同参数的Azure函数的多个副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆