我有一个ARM模板,可以部署Key Vault并使用秘密填充它。它确实根据参数secretsObject中有多少数组创建机密。例如,如果我有:
"secretsObject": {
"type": "secureObject",
"defaultValue": {
"secrets": [
{
"secretName": "exampleSecret1",
"secretValue": "secretVaule1"
},
{
"secretName": "exampleSecret2",
"secretValue": "secretValue2"
}
]
}
}
该模板将创建2个秘密。所以这是我放入.parameters.json以从Visual Studio部署模板的行:
"secrets": [
{
"secretName": "exampleSecret1",
"secretValue": "secretVaule1"
},
{
"secretName": "exampleSecret2",
"secretValue": "secretValue2"
}
]
问题是我无法弄清楚如何将这样的行作为变量传递到VSTS(以覆盖参数)。 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.
答案 0 :(得分:2)
Azure资源组部署任务中存在问题,我在此处提交反馈:VSTS构建/发布任务:Override template parameters of Azure Resource Group Deployment。
解决方法是您可以在构建/发布期间更新参数文件(例如parameter.json),并在Azure资源组部署任务中指定此参数文件。
有许多方法可以更新文件,例如Replace Tokens。
更新
Gitgub中的反馈:https://github.com/Microsoft/vsts-tasks/issues/6108