Skip to content

Only other parameters can be referenced in parameter default values #2946

Answered by anthony-c-martin
martyh888 asked this question in Q&A
Discussion options

You must be logged in to vote

This is unfortunately not supported. If you're calling this from another module, your best option would be to pass the id in as a separate parameter:

  • parent.bicep
    resource pip 'Microsoft.Network/publicIPAddresses@2020-11-01' existing = {
      name: 'myDynamicPublic'
      scope: resourceGroup('rgPublicIPs')
    }
    
    module trafficManager './trafficManager.bicep' = {
      name: 'trafficManager'
      params: {
        pipId: pip.id
      }
    }
  • trafficManager.bicep
    param pipId string
    param trafficManagers array = [
      {
        name: 'test-com'
        endPoints: [
          {
            name: 'IP1'
            targetResourceId: pipId
            target: 'xx'
          }
        ]
      }
    ]

Replies: 1 comment 1 reply

Comment options

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

Answer selected by martyh888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants