gpt4 book ai didi

azure - 无法通过 ARM 模板启动 AD Forest

转载 作者:行者123 更新时间:2023-12-03 04:09:46 25 4
gpt4 key购买 nike

我正在尝试通过 ARM 模板创建 Windows 虚拟机、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

最佳答案

我的工作方式是通过以下命令:

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 也很重要,它报告的错误消息比 HTTP 400 更好。

关于azure - 无法通过 ARM 模板启动 AD Forest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57389001/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com