question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Azure.ResourceManager.Resources does not accept valid Parameter files

See original GitHub issue

Library 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
shenglolcommented, Jun 2, 2022

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.

0reactions
Yao725commented, Nov 1, 2022

Close this issue as we will not support it at least for now based on the offline discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid template errors - Azure Resource Manager
Describes how to resolve invalid template errors when deploying Bicep files or Azure Resource Manager templates (ARM templates).
Read more >
Troubleshoot common Azure deployment errors
Error code Mitigation More inform... AccountNameInvalid Follow naming guidelines for storage accounts. Resolve erro... AccountPropertyCannotBeSet Check available storage account properties. storageAcco... AnotherOperationInProgress Wait for concurrent operation...
Read more >
Resource not found errors - Azure Resource Manager
Describes how to resolve errors when a resource can't be found. The error might occur when you deploy a Bicep file or Azure...
Read more >
Tutorial: Use parameter files to deploy your ARM template
Use parameter files that contain the values to use for deploying your Azure Resource Manager template (ARM template).
Read more >
Create Resource Manager parameter file - Azure
Create parameter file for passing in values during deployment of an Azure Resource Manager template.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found