neilpeterson / azure-blueprints-pipeline-tasks

MIT License
17 stars 16 forks source link

Unable to retrieve secret #38

Closed erleonard closed 5 years ago

erleonard commented 5 years ago

When assigning the blueprint to a subscription, one of the parameters refers to a secret stored in a Azure Key Vault and it errors out.

[error]Can't deserialize the JSON file 'D:\a\1\s\Blueprint\assign.json'. 'Error converting value "@{id=/subscriptions/Msub-id>/resourceGroups/providers/Microsoft.KeyVault/vaults/<keyvaultname}" to type 'Microsoft.Azure.Management.Blueprint.Models.KeyVaultReference'. Path 'reference.keyVault', line 68, position 245.'

My parameter file contains the following:

"adminPassword": { "reference": { "keyVault": { "id": "/subscriptions/<-SUBID->/resourceGroups/<-RESOURCEGROUP->/providers/Microsoft.KeyVault/vaults/<-KEYVAULTNAME->" }, "secretName": "mySuperSecret" } }

If I do the deployment from powershell utilizing New-AzBlueprintAssignment -Blueprint $blueprint -Name 'assignMyBlueprint' -AssignmentFile .\blueprintAssignment.json, it goes without error.

neilpeterson commented 5 years ago

Fixed with this PR - https://github.com/neilpeterson/azure-blueprints-pipeline-tasks/pull/39

I will close the issue once the updated extension has been published to the VS marketplace.

neilpeterson commented 5 years ago

@erleonard I've published version 1.5.1 to the marketplace which includes this update. Thanks again for the PR.

https://marketplace.visualstudio.com/items?itemName=nepeters.azure-blueprints