Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connection string output to Event Hub namespace module #3906

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dciborow
Copy link
Contributor

@dciborow dciborow commented Dec 9, 2024

Fixes #3638

Add output for Event Hub namespace connection string

  • Add output for connection string using listKeys function in avm/res/event-hub/namespace/main.bicep
  • Update outputs section in avm/res/event-hub/namespace/main.bicep to include connection string
  • Document new output for connection string in avm/res/event-hub/namespace/README.md

For more details, open the Copilot Workspace session.

Fixes Azure#3638

Add output for Event Hub namespace connection string

* Add output for connection string using `listKeys` function in `avm/res/event-hub/namespace/main.bicep`
* Update `outputs` section in `avm/res/event-hub/namespace/main.bicep` to include connection string
* Document new output for connection string in `avm/res/event-hub/namespace/README.md`

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Azure/bicep-registry-modules/issues/3638?shareId=XXXX-XXXX-XXXX-XXXX).
@dciborow dciborow requested review from a team as code owners December 9, 2024 21:26
@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue label Dec 9, 2024
@avm-team-linter avm-team-linter bot added the Needs: Module Owner 📣 This module needs an owner to develop or maintain it label Dec 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 Maintainers need to triage still label Dec 9, 2024

Important

The "Needs: Triage 🔍" 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.

Important

If this is a module-related PR, being submitted by the sole owner of the module, the AVM core team must review and approve it (as module owners can't approve their own PRs).

To indicate this PR needs the core team''s attention, apply the "Needs: Core Team 🧞" label!

The core team will only review and approve PRs that have this label applied!

@elanzel
Copy link
Contributor

elanzel commented Dec 10, 2024

Hi @dciborow , event hub connection string is a sensitive information, publishing it as output is not a best practice. We should instead add to the module the possibility to create a keyvault, when required, and store there the connection string as a secret. Something similar has already been done for the storage account https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/storage/storage-account#Outputs
Can you update the code in that way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print the connection string as output is not a security best practice, the suggested way is to leverage a keyvault as already done for the storage account module https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/storage/storage-account#parameter-secretsexportconfiguration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do like like cosmos did: https://github.com/azure-javaee/azure-dev/blob/d1c179a8392341802d0ef686354877b49eb80d24/cli/azd/resources/scaffold/templates/resources.bicept#L104

Image

It's stored in Key Vault, and the key vault id is provided by customer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dciborow,
that is true. @elanzel, this would require an implementation of the corresponding interface as it is already in numerous other modules and documented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Module Owner 📣 This module needs an owner to develop or maintain it Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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