Reputation: 8701
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}
Upvotes: 0
Views: 1387
Reputation: 29482
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]
Upvotes: 2