带有对象参数文件的ARM模板

问题描述 投票:0回答:1

我们正在将一些资源转移到Azure,但似乎ARM模板仍处于起步阶段,还存在很多问题。

出于某些原因,在从本地计算机上使用Powershell进行部署时,部署过程仍然会要求我输入标签的值,但是该部署可以通过Azure Portal UI按预期进行。

我有一个简单的存储模板:

"resources": [
    {
        "name": "[variables('uniqueName')]",
        "type": "Microsoft.Storage/storageAccounts",
        "apiVersion": "2015-06-15",
        "location": "[resourceGroup().location]",
        "tags": "[parameters('resourceTags')]",
        "properties": {
            "accountType": "Standard_LRS"
        }
    }
]

参数文件:

"resourceTags":{
      "value":{
         "Key1": "Value1",
          "Key2": "Value2"
      }
 }

部署powershell文件

$templateFile = ".\temp.json"
$parameterFile=".\temp.parameters.dev.json"
New-AzResourceGroupDeployment `
-Name "Deployment" `
-ResourceGroupName "TemplateDevelopment" `
-TemplateFile $templateFile
-TemplateParameterFile $parameterFile

任何想法我做错了什么?问题是Powershell仍然提示我在部署期间输入resourceTag的值,即使这些值是在参数文件中指定的也是如此

azure powershell arm-template
1个回答
0
投票
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "resourceTags": { "value": { "Key1": "Value1", "Key2": "Value2" } } } }
© www.soinside.com 2019 - 2024. All rights reserved.