gpt4 book ai didi

powershell - 模板验证错误 - 错误 : Code=InvalidTemplate; Message=Deployment template validation failed:

转载 作者:行者123 更新时间:2023-12-03 02:58:21 24 4
gpt4 key购买 nike

我在部署下面的模板时遇到了一些麻烦:

azuredeploy.json file

抛出的错误消息之一:

'The template resource '[concat('nsg-create',copyIndex())]' at line '344' and column '9' is invalid. The api-version '2016-07-01' used to deploy the template does not support 'ResourceGroup' property. Please use api-version '2017-05-10' or later to deploy the template. Please see https://aka.ms/arm-template/#resources for usage details.'.

已用于部署的代码。

 Context "Template Validation" {

It "Template $here\azuredeploy.json and parameter file passes validation" -TestCases $ParameterFileTestCases {
Param( $ParameterFile )
Update-Module -Name AzureRM -Force
$output = New-AzureRmResourceGroupDeployment -ResourceGroupName $TempValidationRG -Force -Mode Complete -TemplateFile "$here\azuredeploy.json" -TemplateParameterFile "$here\$ParameterFile" -ErrorAction Stop 5>&1
$output.ProvisioningState | Should -Be "Succeeded"
}
}

我尝试更改 API 版本,但是仍然出现相同的错误。我不明白如何解决这个问题。我正在尝试通过 pester 测试模板。

Get-Module AzureRM* -ListAvailable 的输出: AzureRM list

最佳答案

您需要使用另一个 api 版本。试试 2017-05-10 这个。

此外,尝试将 Azure Powershell 更新到最新版本。

关于powershell - 模板验证错误 - 错误 : Code=InvalidTemplate; Message=Deployment template validation failed:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51278139/

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