我正在尝试创建Windows VM、AD Forest、Domain和DC by ARM模板。
我在使用这里的模板:
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:编辑,使用template-file不起作用。证据如下:
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发布于 2019-08-08 15:14:25
我的工作方式是通过下面的命令:
az group deployment create -g arm-template --template-uri "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/active-directory-new-domain/azuredeploy.json" --parameters @azuredeploy.parameters.json原因是azuredeploy.json使用templateLink.uri.不幸的是,在安全性方面,你必须使用存储帐户上传文件,并在模板中引用它。
更多阅读here
现在,理解是什么让我意识到是什么让我意识到我使用的是Azure PowerShell而不是Azure Cli,这一点也很重要,它报告了更好的错误消息,只是HTTP400。
https://stackoverflow.com/questions/57389001
复制相似问题