Coder Perfect

In BICEP, is there a MAP type parameter or variable?


Is it possible to recreate the MAP variable in BICEP using TF? In the ARM template reference, I find that “object” is equivalent to a MAP in terms of declaration but not in terms of usage.

( tf – map example

( arm template object / bicep example


Asked by Chief

Solution #1

In Bicep, there is an Object type as well. It is comparable to the ARM version, however there are some minor variations. In Bicep, an object must be declared in multiple lines. Each property in an object consists of key and value. The key and value are separated by a colon (:). An object allows any property of any type.

The key in Bicep is not enclosed by quotations. When separating properties, avoid using commas.

param exampleObject object = {
  name: 'test name'
  id: '123-abc'
  isCurrent: true
  tier: 1

Property accessors are used to gain access to an object’s properties. The. operator is used to create them.

var a = {
  b: 'Dev'
  c: 42
  d: {
    e: true

output result1 string = a.b // returns 'Dev' 
output result2 int = a.c // returns 42
output result3 bool = a.d.e // returns true

To access a property, you can alternatively use the [] syntax. a[‘d’].e is another way to write a.d.e.

Objects in Biceps (reference)

Answered by Bhargavi Annadevara

Post is based on