[BUG] Azure.ResourceManager.Resources does not accept valid Parameter files
See original GitHub issueLibrary name and version
Azure.ResourceManager.Resources 1.0.0
Describe the bug
Our team is working on a Right click bicep deploy feature and as we’ve been adding additional support for users to provide a params file, our deployments were failing if the user wrote their paramters.json file like this
I think Stephen is mentioning that users’s do not have a “metadata” section in any parameters file.
Best practice from our docs says param files are written like this
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"<first-parameter-name>": {
"value": "<first-value>"
},
"<second-parameter-name>": {
"value": "<second-value>"
}
}
}
This is problematic to our Bicep user base because it is accepted when we deploy via the Azure CLI, but even though this is a best practice in our docs, users will fail during this scenario.
Currently users are used to writing our best practice parameters files to deploy via CLI, but now all of our users would be forced to write their parameters files like so:
{
"<first-parameter-name>": {
"value": "<first-value>"
},
"<second-parameter-name>": {
"value": "<second-value>"
}
}
Right now our workaround is to grab the “parameters” key and give that to our deploy flow, but down the road in various areas of our extension that use these parameters files, it creates mistakes and breaks in our code.
Expected behavior
Users should be able to provide either
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"<first-parameter-name>": {
"value": "<first-value>"
},
"<second-parameter-name>": {
"value": "<second-value>"
}
}
}
OR
{
"<first-parameter-name>": {
"value": "<first-value>"
},
"<second-parameter-name>": {
"value": "<second-value>"
}
}
seamlessly. Azure SDK should accept both.
Actual behavior
It fails if you pass in the first option even though it is a best practice for ARM and Bicep.
Reproduction Steps
Steps provided.
Environment
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
I don’t think this is a bug. The parameters property is part of the Deployment model which must be an object containing parameter key value pairs. The SDK shouldn’t be responsible for handling parameter files.
Close this issue as we will not support it at least for now based on the offline discussion.