2

私は、キーボルトを配備したARMテンプレートを持っています。これは、secretsObjectパラメーターに含まれる配列の数に基づいて秘密を作成します。たとえば、私が持っている場合:secureObject配列をVSTS変数として渡す

"secretsObject": { 
    "type": "secureObject", 
    "defaultValue": { 
    "secrets": [ 
     { 
     "secretName": "exampleSecret1", 
     "secretValue": "secretVaule1" 
     }, 
     { 
     "secretName": "exampleSecret2", 
     "secretValue": "secretValue2" 
     } 
    ] 
    } 
} 

テンプレートは2つの秘密を作成します。

 "secrets": [ 
     { 
     "secretName": "exampleSecret1", 
     "secretValue": "secretVaule1" 
     }, 
     { 
     "secretName": "exampleSecret2", 
     "secretValue": "secretValue2" 
     } 
    ] 

問題がある、私は変数としてVSTSにそのような行を過ぎて(上書きする方法を見つけ出すことはできません:これは、私は、Visual Studioからテンプレートを展開する.parameters.jsonに入れラインがありますパラメータ)。 This is the ARM template I'm using

There were errors in your deployment. Error code: InvalidDeploymentParameterKey. 
One of the deployment parameters has an empty key. Please see https://aka.ms/arm-deploy/#parameter-file for details. 
Processed: ##vso[task.issue type=error;]One of the deployment parameters has an empty key. Please see https://aka.ms/arm-deploy/#parameter-file for details. 
task result: Failed 
Task failed while creating or updating the template deployment. 

enter image description here

enter image description here

+0

あなたはそれがパラメータを解析する方法のソースコードをチェックしてhttps://github.com/Microsoft/vsts-tasks/tree/master/Tasks/ AzureResourceGroupDeployment –

+0

値はオブジェクトなので、値を{{"秘密":[{......}]} ' –

+0

に指定してみてください。それは私が参照しているものです。私はちょうど '{"秘密 ":" {"secretName": "exampleSecret1"、 "secretValue": "secretVaule1"}、{"secretName": "exampleSecret2"、 "secretValue": "secretValue2"}、デプロイメントテンプレートの検証に失敗しました: 'テンプレートパラメータ' secretsObject 'の行' 1 'と列' 1411 'に指定された値は、' secretName ': "exampleSecret3"、 "secretValue": "secretVaule3"}]} '有効じゃない。'。 テンプレート配備の作成または更新中にタスクが失敗しました。 ' – WinBoss

答えて

1

ありAzureのリソースグループ導入タスクで問題があると私はここにフィードバックを送信:Override template parameters of Azure Resource Group Deployment:VSTSは、/解除タスクを構築します。

回避策は、ビルド/リリース中にパラメータファイル(parameter.jsonなど)を更新し、Azure Resource Groupデプロイメントタスクでこのパラメータファイルを指定できることです。

Replace Tokensのように、ファイルを更新する方法はたくさんあります。

更新:Gitgubで

フィードバック:https://github.com/Microsoft/vsts-tasks/issues/6108

+0

なぜ機能しないのか説明していただきありがとうございます。 GitHubでその問題を報告する必要があります。 – WinBoss

+0

GitHubで報告します:https://github.com/Microsoft/vsts-tasks/issues/6108 –

関連する問題