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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions avm/res/event-hub/namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,7 @@ Switch to make the Event Hub Namespace zone redundant.
| `resourceGroupName` | string | The resource group where the namespace is deployed. |
| `resourceId` | string | The resource ID of the eventspace. |
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |
| `connectionString` | string | The connection string of the Event Hub namespace. |

## Cross-referenced modules

Expand Down
3 changes: 3 additions & 0 deletions avm/res/event-hub/namespace/main.bicep
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.

Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ output privateEndpoints array = [
}
]

@description('The connection string of the Event Hub namespace using the Root Managed Shared Access Key.')
output connectionString string = listKeys(concat(resourceId('Microsoft.EventHub/namespaces', name), '/AuthorizationRules/RootManageSharedAccessKey'), '2024-01-01').primaryConnectionString

// =============== //
// Definitions //
// =============== //
Expand Down
Loading