ARM 模板错误嵌套资源类型必须具有与其资源名称相同的段数
ARM template error A nested resource type must have identical number of segments as its resource name
希望有人能帮助解决错误。请在下方link获取模板
https://drive.google.com/open?id=15NYD-4Ghh3-DQV46ydfXgFg_VC0hdTSh
谢谢
At line:1 char:1
+ new-azResourceGroupDeployment -ResourceGroupName $ServerResourceGroup ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
new-azResourceGroupDeployment : 13:33:59 - Error:
Code=InvalidTemplate; Message=Deployment template validation failed:
'The template resource 'diukwestdbuk1/storageAccounts' for type
'Microsoft.Storage/storageAccounts' at line '0' and column '0' has
incorrect segment lengths. A nested resource type must have identical
number of segments as its resource name. A root resource type must
have segment length one greater than its resource name. Please see
https://aka.ms/arm-template/#resources for usage details.'.
At line:1 char:1
+ new-azResourceGroupDeployment -ResourceGroupName $ServerResourceGroup ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
new-azResourceGroupDeployment : 13:33:59 - Error:
Code=InvalidTemplate; Message=Deployment template validation failed:
'The template resource 'diagnosticst1/storageAccounts' for type
'Microsoft.Storage/storageAccounts' at line '0' and column '0' has
incorrect segment lengths. A nested resource type must have identical
number of segments as its resource name. A root resource type must
have segment length one greater than its resource name. Please see
https://aka.ms/arm-template/#resources for usage details.'.
这一位是错误的:
concat( variables('vardiagstorageName'),copyIndex(1),'/storageAccounts')
该错误试图向您提示什么:/
用于分隔资源类型,因此如果您在声明资源名称时使用类似 xxx/yyy
的内容,则表示您正在寻找 create\update 名为 yyy
的子资源位于名为 xxx
的资源下。您需要从名称声明中删除 /
,因为在这种情况下您只是在创建存储帐户。
希望有人能帮助解决错误。请在下方link获取模板
https://drive.google.com/open?id=15NYD-4Ghh3-DQV46ydfXgFg_VC0hdTSh
谢谢
At line:1 char:1 + new-azResourceGroupDeployment -ResourceGroupName $ServerResourceGroup ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
new-azResourceGroupDeployment : 13:33:59 - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template resource 'diukwestdbuk1/storageAccounts' for type 'Microsoft.Storage/storageAccounts' at line '0' and column '0' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.
At line:1 char:1 + new-azResourceGroupDeployment -ResourceGroupName $ServerResourceGroup ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
new-azResourceGroupDeployment : 13:33:59 - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template resource 'diagnosticst1/storageAccounts' for type 'Microsoft.Storage/storageAccounts' at line '0' and column '0' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.
这一位是错误的:
concat( variables('vardiagstorageName'),copyIndex(1),'/storageAccounts')
该错误试图向您提示什么:/
用于分隔资源类型,因此如果您在声明资源名称时使用类似 xxx/yyy
的内容,则表示您正在寻找 create\update 名为 yyy
的子资源位于名为 xxx
的资源下。您需要从名称声明中删除 /
,因为在这种情况下您只是在创建存储帐户。