【问题标题】:Azure resource manager templateAzure 资源管理器模板
【发布时间】:2019-01-14 17:35:06
【问题描述】:

我正在尝试使用我的 ARM 代码构建多个 SQL VM。但是,我在创建网络对等互连时遇到了以下错误。

[ERROR] New-AzureRmResourceGroupDeployment : 08:40:20 - Error: Code=InvalidTemplate; 
[ERROR] Message=Deployment template validation failed: 'The template resource 
[ERROR] 'DI_SQLSERVER_VNETag5w7jqj6vp3a_TO_DI_DT_VN' for type 
[ERROR] 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings' at line '488' and 
[ERROR] column '9' has incorrect segment lengths. A nested resource type must have 
[ERROR] identical number of segments as its resource name. A root resource type must 
[ERROR] have segment length one greater than its resource name. Please see 
[ERROR] https://aka.ms/arm-template/#resources for usage details.'.
[ERROR] 
[ERROR] At line:35 char:1
[ERROR] + New-AzureRmResourceGroupDeployment -ResourceGroupName $presourcegroup ...
[ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeplo 
[ERROR]    yment], Exception
[ERROR]     + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets 
[ERROR]    .Implementation.NewAzureResourceGroupDeploymentCmdlet
[ERROR]  
[ERROR] New-AzureRmResourceGroupDeployment : The deployment validation failed
[ERROR] At line:35 char:1
[ERROR] + New-AzureRmResourceGroupDeployment -ResourceGroupName $presourcegroup ...
[ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : CloseError: (:) [New-AzureRmResourceGroupDeploym 
[ERROR]    ent], InvalidOperationException
[ERROR]     + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets 
[ERROR]    .Implementation.NewAzureResourceGroupDeploymentCmdlet
[ERROR] 

请参阅下面的链接以获取代码。希望有人能对以下 arm 模板错误有所了解。

https://drive.google.com/open?id=1Iltf_Qlg9GLPmOKTVDpP2KjrQcLvVZDg

谢谢

【问题讨论】:

    标签: azure-resource-manager azure-template


    【解决方案1】:

    您的对等互连名称应该是这样的:vnet_name/peering_name,因为对等互连不能单独存在(如果您不提供 vnet 名称,它无法确定自己属于哪个 vnet),它是 vnet 的子资源资源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 2020-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多