Azure / bicep-registry-modules

Bicep registry modules
MIT License
493 stars 346 forks source link

[AVM Module Issue]: How to get connection string when event-hub namespace is created by AVM? #3638

Open rujche opened 2 hours ago

rujche commented 2 hours ago

Check for previous/existing GitHub issues

Issue Type?

Feature Request

Module Name

avm/res/event-hub/namespace

(Optional) Module Version

No response

Description

Problem

I tried to get connection string of event hub namespace by method like this:

module eventHubNamespace 'br/public:avm/res/event-hub/namespace:0.7.1' = {
  name: 'eventHubNamespace'
  params: {
    name: '${abbrs.eventHubNamespaces}${resourceToken}'
    location: location
    roleAssignments: [
    ]
    eventhubs: [
      {
        name: 'eventhubone'
      }
    ]
  }
}

...
value: listKeys('${eventHubNamespace.outputs.resourceId}/AuthorizationRules/RootManageSharedAccessKey', '2024-01-01').primaryConnectionString
...

It returns error like this:

Error BCP181: This expression is being used in an argument of the function "listKeys", which requires a value that can be calculated at the start of the deployment. Properties of eventHubNamespace which can be calculated at the start include "name".

Question / Feature request

My question is: How can I get connection when event hub namespace is created by br/public:avm/res/event-hub/namespace:0.7.1 ? May be we can add the connection-string in output?

(Optional) Correlation Id

No response

microsoft-github-policy-service[bot] commented 2 hours ago

[!IMPORTANT] The "Needs: Triage :mag:" label must be removed once the triage process is complete!

[!TIP] For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

avm-team-linter[bot] commented 2 hours ago

@rujche, thanks for submitting this issue for the avm/res/event-hub/namespace module!

[!IMPORTANT] A member of the @Azure/avm-res-eventhub-namespace-module-owners-bicep or @Azure/avm-res-eventhub-namespace-module-contributors-bicep team will review it soon!