问题
I have such a azuredeploy.parameters.json file:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminLogin": {
"value": "exampleadmin"
},
"adminPassword": {
"reference": {
"keyVault": {
"id": "/subscriptions/[subscription().subscriptionId]/resourceGroups/ARMTemplate/providers/Microsoft.KeyVault/vaults/dev-kv"
},
"secretName": "ExamplePassword"
}
},
"sqlServerName": {
"value": "TestServer"
}
}
}
My aim is to extract the current subscriptionId and integrate it into the id
.
Is it possible in parameter file to do this job?
回答1:
if it works, the correct syntax would be:
"id": "[concat(subscription().id, '/resourceGroups/ARMTemplate/providers/Microsoft.KeyVault/vaults/dev-kv')]"
if it doesnt work you can use a nested deployment to pass it as an argument to a nested deployment and return the value from it or just execute your stuff in a nested deployment
来源:https://stackoverflow.com/questions/57060384/get-current-subscription-id-in-parameter-file