我正在尝试部署 ARM 模板。
这里是模板和参数文件路径:
[string]
$templateFilePath = "C:\Users\Desktop\template_abc.json",
[string]
$parametersFilePath = "C:\Users\Desktop\parameters_xyz.json"
)
Deployment commands:
Write-Host "Starting deployment...";
if(Test-Path $parametersFilePath) {
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
}
else {
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
}
我想在我的部署中再添加一个参数文件,例如:parameters_lmn.json,如何在单个部署中同时容纳 xyz 和 lmn 参数文件?
最佳答案
您可以使用https://powersnippets.com/join-object/合并两个 json 对象。 您需要决定哪个参数文件覆盖另一个参数文件,以防两者定义相同的参数。
关于powershell - 如何在powershell中传递多个参数文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50128808/