Last active
November 5, 2021 14:33
-
-
Save cloudchristoph/8b93d9a4e3468a030179d9d8a94e0981 to your computer and use it in GitHub Desktop.
Bicep - nested loop with module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param sbNamespaceName string = 'sbnamespace' | |
param topics array = [ | |
{ | |
name: 'topic1' | |
subscriptions: [ | |
'sub1.1' | |
'sub1.2' | |
] | |
} | |
{ | |
name: 'topic2' | |
subscriptions: [ | |
'sub2.1' | |
] | |
} | |
] | |
module servicebusTopic 'sbtopic.bicep' = [for topic in topics: { | |
name: topic.name | |
params: { | |
topic: topic | |
sbNamespaceName: sbNamespaceName | |
} | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param sbNamespaceName string | |
param topic object | |
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' existing = { | |
name: sbNamespaceName | |
} | |
resource serviceBusTopic 'Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview' = { | |
name: topic.name | |
parent: serviceBusNamespace | |
resource serviceBusSubscription 'subscriptions@2021-06-01-preview' = [for sub in topic.subscriptions: { | |
name: sub | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment