This module creates an Azure Event Hub Namespace.
You can optionally configure firewall and network rules, event hubs, diagnostics and resource lock.
param deploymentName string = 'eh${utcNow()}'
param location string = resourceGroup().location
module eventHub 'eventhub.bicep' = {
name: deploymentName
params: {
eventHubNamespaceName: 'myEventHubNamespace'
location: location
eventHubSku: 'Standard'
resourcelock: 'CanNotDelete'
enableDiagnostics: true
diagnosticLogAnalyticsWorkspaceId: 'myLogAnalyticsWorkspaceResourceId'
}
}
param deploymentName string = 'eh${utcNow()}'
param location string = resourceGroup().location
module eventHub 'eventhub.bicep' = {
name: deploymentName
params: {
eventHubNamespaceName: 'myEventHubNamespace'
location: location
eventHubSku: 'Standard'
networkRuleSet: {
defaultAction: 'Deny'
publicNetworkAccess: 'Enabled'
trustedServiceAccessEnabled: true
ipRules: [
{
ipMask: '172.32.0.10'
action: 'Allow'
}
]
virtualNetworkRules: [
{
ignoreMissingVnetServiceEndpoint: true
subnet: {
id: 'MySubnetResourceId'
}
}
]
}
}
}
param deploymentName string = 'eh${utcNow()}'
param location string = resourceGroup().location
module eventHub 'eventhub.bicep' = {
name: deploymentName
params: {
eventHubNamespaceName: 'myEventHubNamespace'
location: location
eventHubSku: 'Standard'
eventHubs: [
{
eventHubName: 'eventHub1'
messageRetentionInDays: 1
partitionCount: 1
captureSettings: {
provider: 'StorageAccount'
archiveNameFormat: '{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}'
blobContainer: 'capture'
storageAccountResourceId: 'MyStorageAccountResourceId'
}
}
{
eventHubName: 'eventHub2'
messageRetentionInDays: 1
partitionCount: 1
}
]
}
}