I would like to deploy a template from the Azure Resource Manager QuickStart Templates.
Many of the templates there have a default value specified in the template file (for example this one azuredeploy.json ):
"ouPath": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Specifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU in quotation marks. Example: 'OU=testOU; DC=domain; DC=Domain; DC=com"
}
},
However, the corresponding azuredeploy.parameters.json does not define the ouPath
value.
When I specify the file in --parameters-file
in the Azure CLI call:
azure group deployment create "${resource_group_name}" "${deployment_name}" --template-uri "${template_uri}" --parameters-file ${parameters_file}
I get an error:
info: Executing command group deployment create
error: Template and Deployment "parameters" objects lengths do not match
Deployment Parameter file does not have { ouPath } defined.
error: Error information has been recorded to /Users/techraf/.azure/azure.err
error: group deployment create command failed
If I define add the value explicitly to the parameters.json
file, the deployment works properly.
Main question:
The sheer number of examples (parameters.json
) in the above Azure repository without explicitly specified values makes me think, there must be a way to tell Azure to use default value instead of providing it in parameters.json
.
Is there a way to avoid adding the values that have defaultValue
defined in the template file when using Azure CLI?
Additional question:
Worse yet, in the example I have given above, the default value is empty and if I specify an empty value in the parameters.json
:
"ouPath": {
"value": ""
},
I get an interactive prompt for the value.
How can I avoid that?
It seems it was a bug in Azure CLI 0.10.5.
The problem does not happen with the 0.10.6 although the release notes do not mention this fix explicitly.