Azure / Azure/azure-devtestlab

Task AzureDevTestLabsCreateVM cannot handle key vault reference in the arm template

Open
#677 1 comment 0 reactions 0 assignees View on GitHub
bug tasks
Dominant language
PowerShell
Stars
465
Forks
595
PR merge metrics
No merged PRs in 30d

Description

I'm trying to call task AzureDevTestLabsCreateVM in my yaml pipeline. I pass in the arm template and parameter file to the task. For sensitive parameters such as SAS token or password, I store them in key vault and reference the key vault in the parameter json file. For demo, I use the example json from https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/key-vault-parameter?tabs=azure-cli :

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminPassword": {
"reference": {
"keyVault": {
"id": "/subscriptions//resourceGroups//providers/Microsoft.KeyVault/vaults/"
},
"secretName": "ExamplePassword"
}
}
}
}

However, the task give me this following error:
[error]Error => code: 'undefined'; message = 'Cannot read property 'toString' of undefined'

I then dug into the source code, and here is what I found:
https://github.com/Azure/azure-devtestlab/blob/cbca7792cbb717cf9dc613e1569f2dd7ce5cf546/tasks/Node/src/modules/task-utils/deployutil.ts#L96

This piece of code seems it only handles 'value' of parameter, and not 'reference', although 'reference' is allowed according to the schema.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.