Nested loops #3420
-
Hello Bicep community I was hoping someone could share their thoughts on how he/she would implement the creation of a Service Bus using Bicep, given the following json object, passed as a parameter to the bicep template: {
"topics": [
{
"name": "agreements",
"subscriptions": []
},
{
"name": "businessentities",
"subscriptions": [
{
"name": "Affinity"
},
{
"name": "DataWareHouse"
},
{
"name": "Group"
},
{
"name": "HoldingTerminator"
},
{
"name": "Optimum"
},
{
"name": "Path"
},
{
"name": "Pension"
},
{
"name": "Securities"
},
{
"name": "Visis"
},
{
"name": "Zonder"
}
]
}
]
} I'm able to successfully create all the service bus topics by looping over the "topics" items. However, for each topic I need to create their corresponding subscriptions. This is where I am a bit stuck as subscriptions are defined in Bicep as separate resources. It seems that below snippet is not supported, yielding an error that a nested resource cannot appear in a resource with a for-expression.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Here is another related discussion on this: #3146 The answer is that modules can make this task easier. |
Beta Was this translation helpful? Give feedback.
Here is another related discussion on this: #3146
The answer is that modules can make this task easier.