-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Describe the issue
Using bicep lambda functions will cause parsing error. Seems like => is causing this.
Microsoft documentation: Lambda functions for Bicep
These functions are crucial in Bicep to generate and manipulate array output due to ARM limitations with for each loops when referencing resource output. Without lambda functions we need to implement workarounds with submodules for array manipulation which is rather unpleasant.
Example Value (as of MS documentation)
var dogs = [
{
name: 'Evie'
age: 5
interests: ['Ball', 'Frisbee']
}
{
name: 'Casper'
age: 3
interests: ['Other dogs']
}
{
name: 'Indy'
age: 2
interests: ['Butter']
}
{
name: 'Kira'
age: 8
interests: ['Rubs']
}
]
output dogNames array = map(dogs, dog => dog.name)
output sayHi array = map(dogs, dog => 'Hello ${dog.name}!')
output mapArray array = map(range(0, length(dogs)), i => {
i: i
dog: dogs[i].name
greeting: 'Ahoy, ${dogs[i].name}!'
})
output mapArrayIndex array = map(dogs, (x, i) => { index: i, val: x.name})