Reputation: 397
Hope somebody can help to resolve the error. Please the link below for the template
https://drive.google.com/open?id=15NYD-4Ghh3-DQV46ydfXgFg_VC0hdTSh
Thanks
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.'.
Upvotes: 6
Views: 11986
Reputation: 72191
this bit is wrong:
concat( variables('vardiagstorageName'),copyIndex(1),'/storageAccounts')
what the error is trying to suggest you: /
is used to delimit resource types, so if you use something like xxx/yyy
when you declare the resource name it implies you are looking to create\update subresource called yyy
under resource called xxx
. you need to remove the /
from your name declation, because in this case you are just creating the storage account.
Upvotes: 13