Skip to content

How to refer a parent in module when using loop for creating resources? #13826

Answered by johnlokerse
h00jraq asked this question in General
Discussion options

You must be logged in to vote

You already got great suggestions, but I would suggest to consolidate the topics and subscriptions deployment. In the Bicep template below, you see the combined the infrastructure for topics and subscriptions into a module. By doing this, some of the dependency and loop complexity is resolved because it will be handled by the Azure Resource Manager instead.

Main bicep template:

@description('Name of the Service Bus namespace')
param serviceBusNamespaceName string

@description('Location for all resources.')
param location string = resourceGroup().location
param topicsAndSubscriptions array

resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-01-01-preview' = {
  name: servi…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ManagedUx
Comment options

Comment options

You must be logged in to vote
1 reply
@h00jraq
Comment options

Answer selected by h00jraq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants