【发布时间】:2019-08-07 07:24:25
【问题描述】:
我正在尝试通过 ARM 模板创建 Windows VM、AD 森林、域和 DC。
我正在使用这里的模板:
https://github.com/Azure/azure-quickstart-templates/tree/master/active-directory-new-domain
我创建了资源组,然后通过以下命令进行部署:
az group create --name arm-template --location "australiaeast"
az group deployment create -g arm-template --template-file=azuredeploy.json --parameters=azuredeploy.parameters.json
很遗憾,我收到以下错误:
400 Client Error: Bad Request for url: https://management.azure.com/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxx/resourcegroups/arm-template/providers/Microsoft.Resources/deployments/azuredeploy?api-version=2018-05-01
我可以通过使用完全相同的参数转到 Azure 门户手动创建它们!想知道是什么问题以及如何解决它。
P。 S:编辑,使用模板文件不起作用。证据如下:
PS E:\OnlyOnMyPC\azure-quickstart-templates\active-directory-new-domain> New-AzResourceGroupDeployment -ResourceGroupName arm-template
-TemplateFile azuredeploy.json -TemplateParameterFile .\azuredeploy.parameters.json
New-AzResourceGroupDeployment : 5:27:27 PM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The
template resource '_artifactsLocation' at line '37' and column '31' is not valid: The language expression property 'templateLink'
doesn't exist, available properties are 'template, templateHash, parameters, mode, provisioningState'.. Please see
https://aka.ms/arm-template-expressions for usage details.'.
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName arm-template -Templa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
New-AzResourceGroupDeployment : The deployment validation failed
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName arm-template -Templa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzResourceGroupDeployment], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
【问题讨论】:
-
用 cloudshell 试试同样的方法,我怀疑你的 azcli 有问题
-
尝试使用 cloudshell 相同的错误。尝试使用 --verbose 但它没有提供任何价值。
-
试试powershell?
-
是的,尝试使用 PowerShell 并意识到它需要 Template-url 所以本地文件不会这样做
-
废话,你可以使用本地文件
标签: azure active-directory arm-template