我有一个ARM模板和参数文件 此处我想用它来创建一个带有流量管理器和自定义主机名的功能型网络应用。 目前它只是一个单一的web应用。
然而,一旦我把这个工作做好了,计划将这个模板拆分开来,并根据环境向链接的模板添加额外的web应用。
当我试图部署它时,我得到了错误(通过PowerShell)。
5:13:13 PM - Resource Microsoft.Web/sites/hostNameBindings 'siteapidev2-lbxvta4fkayk6-site-0/domain-dev-tm.trafficmanager.net' failed with message '{
"Code": "Conflict",
"Message": "Cannot modify this site because another operation is in progress. Details: Id: 9be2181b-16c3-4141-a4fa-80bc331d5f3c, OperationName: RegisterTrafficManagerProfile, CreatedTime: 4/6/2018 4:13:07 PM, RequestId: 1a1debb6-bba2-487d-a2cf-b49f671f8a52, EntityType: 1",
"Target": null,
"Details": [
{
"Message": "Cannot modify this site because another operation is in progress. Details: Id: 9be2181b-16c3-4141-a4fa-80bc331d5f3c, OperationName: RegisterTrafficManagerProfile, CreatedTime: 4/6/2018 4:13:07 PM, RequestId: 1a1debb6-bba2-487d-a2cf-b49f671f8a52, EntityType: 1"
},
{
"Code": "Conflict"
},
{
"ErrorEntity": {
"ExtendedCode": "59203",
"MessageTemplate": "Cannot modify this site because another operation is in progress. Details: {0}",
"Parameters": [
"Id: 9be2181b-16c3-4141-a4fa-80bc331d5f3c, OperationName: RegisterTrafficManagerProfile, CreatedTime: 4/6/2018 4:13:07 PM, RequestId: 1a1debb6-bba2-487d-a2cf-b49f671f8a52, EntityType: 1"
],
"Code": "Conflict",
"Message": "Cannot modify this site because another operation is in progress. Details: Id: 9be2181b-16c3-4141-a4fa-80bc331d5f3c, OperationName: RegisterTrafficManagerProfile, CreatedTime: 4/6/2018 4:13:07 PM, RequestId: 1a1debb6-bba2-487d-a2cf-b49f671f8a52, EntityType: 1"
}
}
],
"Innererror": null
}'
At D:\path\deploy.ps1:110 char:5
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
我认为这个错误是由流量管理器无法完成引起的,因为它所依赖的Web站点也尚未完成。
我之前得到的另一个错误看起来很像这个。awverify错误
在我看来,出现这种情况是因为网络应用程序创建过程试图添加一个未绑定的自定义域名。发生这种情况是因为在创建 Web 应用程序时,流量管理器进程尚未将其 DNS 主机名作为 CNAME 插入到 Web 应用程序中。
这导致我在 hostNameBinding
的流量管理器和流量管理器配置文件本身(见模板的第 349 行)。
因此,似乎存在某种依赖性循环。 有什么最好的方法来实现这个问题。
如果我手动创建webapp和流量管理器,我能够执行这些步骤。然而,当我从门户网站下载模板时,它无法工作。
我还发现,如果我从模板中删除第349行,然后运行模板两次,第一次产生错误,第二次成功。
有点晚了,但供以后参考。
我看到这个错误发生在使用多个 hostnameBindings
的单一App服务。 在我看来,你部署了3个不同的 hostnameBinding
资源到 App 服务(第 320 到 367 行)。
为了解决这个问题,您应该使用 copy
的功能,在此解释 所以回答.
当然,模板中可能也有其他的问题,但这个对我来说是最明显的,一定会有所改变!