Having issue using KeyVault to fetch secret parameters to my ARM template.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "securestring",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"reference": {
"keyVault": {
"id": "/subscriptions/{sub_id}/resourceGroups/{groupname}/providers/Microsoft.KeyVault/vaults/{myVault}"
},
"secretName": "password"
},
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
}
[...]
}
Invoking the template as follows:
azure group deployment create -g TestResourceGroup -f simplevm.json -e simplevm.parameters.json -n TestDeployment
I still get prompted for an adminPassword, which instead should be taken from KeyVault (permissions are OK). After I enter I fake password, it fails:
info: Executing command group deployment create
info: Supply values for the following parameters
adminPassword: fakepwd
+ Initializing template configurations and parameters
+ Creating a deployment
error: InvalidRequestContent : The request content was invalid and could not be deserialized: 'Could not find member 'reference' on object of type 'TemplateInputParameter'. Path 'properties.template.parameters.adminPassword.reference', line 1, position 293.'.
error: Deployment validate failed.
$ azure --version
0.10.7 (node: 5.1.0)
Same issue here. Did you ever get this working?
Did you ever get this working?
I also tried to keep the password parameter definition without default value, and pass the value as reference in the dynamic parameters like this:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "securestring",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
}
[...]
}
parameters
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminPassword": {
"reference": {
"keyVault": {
"id": "/subscriptions/{sub_id}/resourceGroups/{groupname}/providers/Microsoft.KeyVault/vaults/{myVault}"
},
"secretName": "password"
}
}
}
But I get the following error:
'Could not find member 'reference' on object of type 'TemplateInputParameter'
How is it meant to work ?
After a new try, it's working...
I had accidentally an invalid schema in the template file... my bad.
Please can you provide the schema you used for?
I have the same error message...
Same here...
This error is due to using the "reference" object within the main ARM template itself. That won't work, instead you need to use it in a separate parameters json file which you pass to the resource group deployment task on execution (azure group deployment create or New-AzureRmResourceGroupDeployment).
I also have the same issue. but I got this following error. How to I rectify it?
Azure Error: InvalidRequestContent
Message: The request content was invalid and could not be deserialized: 'Could not find member 'networkProfile' on object of type 'TemplateResource'. Path 'properties.template.resources[1].networkProfile', line 1, position 623.'.
I have the same error on importing certificate for a custom domain.
The request content was invalid and could not be deserialized: 'Could not find member 'SubscriptionId' on object of type 'ResourceDefinition'. Path 'SubscriptionId', line 1, position 56.'.
Was this issue resolved? I am experiencing the same
Usually when I see this error I'm missing a bracket or a quote or something from a previous block
Is this still an issue? I'm having the same trouble
Open 2016... jeez
Most helpful comment
Please can you provide the schema you used for?
I have the same error message...