使用ARM模板平行地部署Azure AppService
我正在尝试使用基于管理员决策的ARM模板来解决一个用途,以部署20至30个Azure Appservices。
这是通过使用Microsoft Fluent库(Microsoft.azure.management.fluent& microsoft.azure.Management.ResourceManager.fluent)的C#WebAPI,
var creds = new AzureCredentialsFactory().FromServicePrincipal(clientId,
clientSecret,
tenantId,
AzureEnvironment.AzureGlobalCloud);
var azure = Azure.Authenticate(creds).WithSubscription(subscriptionId);
var deployment = azure.Deployments.Define($"deployment-{userName}")
.WithExistingResourceGroup(resourceGroupName)
.WithTemplate(templateJson.ToString())
.WithParametersLink(templateParamsBlobURL, "1.0.0.0")
.WithMode(Microsoft.Azure.Management.ResourceManager.Fluent.Models.DeploymentMode.Incremental)
.Create();
问题语句 当管理员决定运行20个AppServices时,上面的代码行将执行和配置这些AppServices,该决定基于Admin。
对我来说,部署是按顺序进行的,即完成一个AppService部署后,它会触发下一个AppService部署,这需要大量时间来完成整个操作。我正在尝试并行实现20个AppServices(由管理员决定)的部署,以便最早以最
友善的态度来帮助我如何使用ARM模板实现AppServices的平行部署
I am trying to solve a use-case of deploying 20 to 30 Azure AppServices using ARM template based on Admin decision.
This is happening through c# webapi using Microsoft Fluent library(Microsoft.Azure.Management.Fluent & Microsoft.Azure.Management.ResourceManager.Fluent),
var creds = new AzureCredentialsFactory().FromServicePrincipal(clientId,
clientSecret,
tenantId,
AzureEnvironment.AzureGlobalCloud);
var azure = Azure.Authenticate(creds).WithSubscription(subscriptionId);
var deployment = azure.Deployments.Define(quot;deployment-{userName}")
.WithExistingResourceGroup(resourceGroupName)
.WithTemplate(templateJson.ToString())
.WithParametersLink(templateParamsBlobURL, "1.0.0.0")
.WithMode(Microsoft.Azure.Management.ResourceManager.Fluent.Models.DeploymentMode.Incremental)
.Create();
Problem statement
When the admin decides to run 20 AppServices, then the above lines of code will execute and provision these AppServices, the decision is based on admin.
For me the Deployment is happening in sequential manner i.e., upon completing one AppService deployment then it triggers the next AppService deployment, which takes huge time to complete the entire operation. I am trying to achieve the deployment of 20 AppServices(decided by admin) in parallel so that the provisioning completes at the earliest
Kindly assist me on how to achieve the parallel deployment of AppServices using ARM template
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢您确认 @ guptha ,与答案相同,以帮助其他社区成员进行类似查询,一次在ARM模板中一次迭代多次资源。
例如,创建多个存储帐户;
有关完整的设置,请参阅此 Microsoft文档 | 手臂模板中的资源迭代
Thanks for confirming @Guptha, posted the same as an answer to help other community members for the similar query , To iteration multiple resources at a time in ARM TEMPLATE .
For example to create multiple storage accounts ;
For complete setup please refer this MICROSOFT DOCUMENTATION|Resource iteration in ARM templates