0

I'm currently trying to manually convert an existing ARM template to bicep because the automated decompile method fails.

The existing template contains the following variables:

"environmentSize": {
        "dev": "small",
        "msdn": "small",
        "int": "small",
        "act": "large",
        "prod": "large"
    },
    "size": "[variables('environmentSize')[parameters('environment')]]",

What would be the equivalent with Bicep?

I've tried the following but it's clearly wrong as I get a red squiggly below the $:

var environmentSize = {
  dev:'small'
  msdn:'small'
  int:'small'
  act:'large'
  prod:'large'
}
var size = environmentSize.${environment}

1 Answer 1

2

Using brackets notation should work.

param environment string = 'dev'

var environmentSize = {
  dev:'small'
  msdn:'small'
  int:'small'
  act:'large'
  prod:'large'
}

output size string = environmentSize[environment]

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.