Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported variables into .bicepparam from ARM JSON templates are not evaluated #14069

Closed
jeskew opened this issue May 10, 2024 · 0 comments · Fixed by #14070
Closed

Imported variables into .bicepparam from ARM JSON templates are not evaluated #14069

jeskew opened this issue May 10, 2024 · 0 comments · Fixed by #14070

Comments

@jeskew
Copy link
Contributor

jeskew commented May 10, 2024

Bicep version
0.26.170

Describe the bug
Ran into this while working on #13997. When importing from ARM JSON templates into .bicepparam files, expressions in variable declarations will not be evaluated. I believe this is a regression introduced in version 0.25.53, so importing from JSON into .bicepparam files must be used infrequently (if at all).

To Reproduce
main.bicep

param intParam int

test.json

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.26.170.59819",
      "templateHash": "15627574382354327639"
    },
    "__bicep_exported_variables!": [
      {
        "name": "a"
      }
    ]
  },
  "variables": {
    "a": "[add(2, 2)]"
  },
  "resources": []
}

test.bicepparam

using 'main.bicep'

import { a } from 'test.json'

param intParam = a

Compiling test.bicepparam will result in the following JSON:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "intParam": {
      "value": "[add(2, 2)]"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant