Microsoft.EventHub namespaces/eventhubs

Bicep resource definition

The namespaces/eventhubs resource type can be deployed to:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.EventHub/namespaces/eventhubs resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.EventHub/namespaces/eventhubs@2022-01-01-preview' = {
  name: 'string'
  parent: resourceSymbolicName
  properties: {
    captureDescription: {
      destination: {
        name: 'string'
        properties: {
          archiveNameFormat: 'string'
          blobContainer: 'string'
          dataLakeAccountName: 'string'
          dataLakeFolderPath: 'string'
          dataLakeSubscriptionId: 'string'
          storageAccountResourceId: 'string'
        }
      }
      enabled: bool
      encoding: 'string'
      intervalInSeconds: int
      sizeLimitInBytes: int
      skipEmptyArchives: bool
    }
    messageRetentionInDays: int
    partitionCount: int
    status: 'string'
  }
}

Property values

namespaces/eventhubs

Name Description Value
name The resource name

See how to set names and types for child resources in Bicep.
string (required)

Character limit: 1-256

Valid characters:
Alphanumerics, periods, hyphens and underscores.

Start and end with letter or number.
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: namespaces
properties Properties supplied to the Create Or Update Event Hub operation. EventhubProperties

EventhubProperties

Name Description Value
captureDescription Properties of capture description CaptureDescription
messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days int
partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. int
status Enumerates the possible values for the status of the Event Hub. 'Active'
'Creating'
'Deleting'
'Disabled'
'ReceiveDisabled'
'Renaming'
'Restoring'
'SendDisabled'
'Unknown'

CaptureDescription

Name Description Value
destination Properties of Destination where capture will be stored. (Storage Account, Blob Names) Destination
enabled A value that indicates whether capture description is enabled. bool
encoding Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version 'Avro'
'AvroDeflate'
intervalInSeconds The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds int
sizeLimitInBytes The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes int
skipEmptyArchives A value that indicates whether to Skip Empty Archives bool

Destination

Name Description Value
name Name for capture destination string
properties Properties describing the storage account, blob container and archive name format for capture destination DestinationProperties

DestinationProperties

Name Description Value
archiveNameFormat Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order string
blobContainer Blob container Name string
dataLakeAccountName The Azure Data Lake Store name for the captured events string
dataLakeFolderPath The destination folder path for the captured events string
dataLakeSubscriptionId Subscription Id of Azure Data Lake Store string
storageAccountResourceId Resource id of the storage account to be used to create the blobs string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
PubNub Realtime Gateway for Azure Event Hubs

Deploy to Azure
The PubNub Realtime Gateway for Azure provides a realtime data stream bridge between the PubNub Data Stream Network and Azure Event Hubs. -- consider it a bi-directional bridge between PubNub and Azure!
Azure Digital Twins with Time Data History Connection

Deploy to Azure
This template creates an Azure Digital Twins instance configured with a time series data history connection. In order to create a connection, other resources must be created such as an Event Hubs namespace, an event hub, Azure Data Explorer cluster, and a database. Data is sent to an event hub which eventually forwards the data to the Azure Data Explorer cluster. Data is stored in a database table in the cluster
Create Event Grid custom topic and event hub handler

Deploy to Azure
Creates an Azure Event Grid custom topic and event hub to handle the events.
Create an EventHubs namespace, Event Hub, & consumer group

Deploy to Azure
This template enables you to deploy an Event Hubs Standard namespace, an Event Hub, and a consumer group.
Create EventHubs authorizationRules

Deploy to Azure
This template enables you to deploy a EventHubs Standard namespace, an Event Hub, a consumer group and authorizationRules
Creates Eventhub cluster, namesapce & eventhub

Deploy to Azure
This template enables you to create EventHubs Cluster, namespace and eventhub in cluster
Create EventHubs with Capture enabled

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub and enabling Capture on it
Create EventHubs with Capture enabled (ADLS)

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub and enabling Capture on it
Create an EventHubs namespace and enable auto-inflate

Deploy to Azure
This template enables you to deploy an Event Hubs Standard namespace, an Event Hub, and a consumer group.This template also turns on the auto-inflate feature on your namespace.
Create an event hub

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub.
Connect to a Event Hubs namespace via private endpoint

Deploy to Azure
This sample shows how to use configure a virtual network and private DNS zone to access a Event Hubs namespace via a private endpoint.
Deploy an Azure Health Data Services MedTech service

Deploy to Azure
This template creates an instance of the Azure Health Data Services MedTech service. The MedTech service is an optional service of the Azure Health Data Services designed to ingest health data from multiple and disparate Internet of Medical Things (IoMT) devices and persist the health data in a Fast Healthcare Interoperable Resources (FHIR®) service within the Azure Health Data Services workspace.
Deploy Azure Data Explorer db with Event Hub connection

Deploy to Azure
Deploy Azure Data Explorer db with Event Hub connection.
Azure SQL Server with Auditing written to Event Hub

Deploy to Azure
This template allows you to deploy an Azure SQL server with Auditing enabled to write audit logs to Event Hub
Create SQL MI with configured sending of logs and metrics

Deploy to Azure
This template allows you to deploy SQL MI and additional resources used for storing logs and metrics (diagnostic workspace, storage account, event hub).
Create an Environment with an Event Hub Event Source

Deploy to Azure
This template enables you to deploy a Time Series Insights environment that is configured to consume events from an Event Hub.

ARM template resource definition

The namespaces/eventhubs resource type can be deployed to:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.EventHub/namespaces/eventhubs resource, add the following JSON to your template.

{
  "type": "Microsoft.EventHub/namespaces/eventhubs",
  "apiVersion": "2022-01-01-preview",
  "name": "string",
  "properties": {
    "captureDescription": {
      "destination": {
        "name": "string",
        "properties": {
          "archiveNameFormat": "string",
          "blobContainer": "string",
          "dataLakeAccountName": "string",
          "dataLakeFolderPath": "string",
          "dataLakeSubscriptionId": "string",
          "storageAccountResourceId": "string"
        }
      },
      "enabled": "bool",
      "encoding": "string",
      "intervalInSeconds": "int",
      "sizeLimitInBytes": "int",
      "skipEmptyArchives": "bool"
    },
    "messageRetentionInDays": "int",
    "partitionCount": "int",
    "status": "string"
  }
}

Property values

namespaces/eventhubs

Name Description Value
type The resource type 'Microsoft.EventHub/namespaces/eventhubs'
apiVersion The resource api version '2022-01-01-preview'
name The resource name

See how to set names and types for child resources in JSON ARM templates.
string (required)

Character limit: 1-256

Valid characters:
Alphanumerics, periods, hyphens and underscores.

Start and end with letter or number.
properties Properties supplied to the Create Or Update Event Hub operation. EventhubProperties

EventhubProperties

Name Description Value
captureDescription Properties of capture description CaptureDescription
messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days int
partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. int
status Enumerates the possible values for the status of the Event Hub. 'Active'
'Creating'
'Deleting'
'Disabled'
'ReceiveDisabled'
'Renaming'
'Restoring'
'SendDisabled'
'Unknown'

CaptureDescription

Name Description Value
destination Properties of Destination where capture will be stored. (Storage Account, Blob Names) Destination
enabled A value that indicates whether capture description is enabled. bool
encoding Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version 'Avro'
'AvroDeflate'
intervalInSeconds The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds int
sizeLimitInBytes The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes int
skipEmptyArchives A value that indicates whether to Skip Empty Archives bool

Destination

Name Description Value
name Name for capture destination string
properties Properties describing the storage account, blob container and archive name format for capture destination DestinationProperties

DestinationProperties

Name Description Value
archiveNameFormat Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order string
blobContainer Blob container Name string
dataLakeAccountName The Azure Data Lake Store name for the captured events string
dataLakeFolderPath The destination folder path for the captured events string
dataLakeSubscriptionId Subscription Id of Azure Data Lake Store string
storageAccountResourceId Resource id of the storage account to be used to create the blobs string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
PubNub Realtime Gateway for Azure Event Hubs

Deploy to Azure
The PubNub Realtime Gateway for Azure provides a realtime data stream bridge between the PubNub Data Stream Network and Azure Event Hubs. -- consider it a bi-directional bridge between PubNub and Azure!
Azure Digital Twins with Time Data History Connection

Deploy to Azure
This template creates an Azure Digital Twins instance configured with a time series data history connection. In order to create a connection, other resources must be created such as an Event Hubs namespace, an event hub, Azure Data Explorer cluster, and a database. Data is sent to an event hub which eventually forwards the data to the Azure Data Explorer cluster. Data is stored in a database table in the cluster
Create Event Grid custom topic and event hub handler

Deploy to Azure
Creates an Azure Event Grid custom topic and event hub to handle the events.
Create an EventHubs namespace, Event Hub, & consumer group

Deploy to Azure
This template enables you to deploy an Event Hubs Standard namespace, an Event Hub, and a consumer group.
Create EventHubs authorizationRules

Deploy to Azure
This template enables you to deploy a EventHubs Standard namespace, an Event Hub, a consumer group and authorizationRules
Creates Eventhub cluster, namesapce & eventhub

Deploy to Azure
This template enables you to create EventHubs Cluster, namespace and eventhub in cluster
Create EventHubs with Capture enabled

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub and enabling Capture on it
Create EventHubs with Capture enabled (ADLS)

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub and enabling Capture on it
Create an EventHubs namespace and enable auto-inflate

Deploy to Azure
This template enables you to deploy an Event Hubs Standard namespace, an Event Hub, and a consumer group.This template also turns on the auto-inflate feature on your namespace.
Create an event hub

Deploy to Azure
This template enables you to deploy a EventHubs namespace with an event hub.
Connect to a Event Hubs namespace via private endpoint

Deploy to Azure
This sample shows how to use configure a virtual network and private DNS zone to access a Event Hubs namespace via a private endpoint.
Deploy an Azure Health Data Services MedTech service

Deploy to Azure
This template creates an instance of the Azure Health Data Services MedTech service. The MedTech service is an optional service of the Azure Health Data Services designed to ingest health data from multiple and disparate Internet of Medical Things (IoMT) devices and persist the health data in a Fast Healthcare Interoperable Resources (FHIR®) service within the Azure Health Data Services workspace.
Deploy Azure Data Explorer db with Event Hub connection

Deploy to Azure
Deploy Azure Data Explorer db with Event Hub connection.
Azure SQL Server with Auditing written to Event Hub

Deploy to Azure
This template allows you to deploy an Azure SQL server with Auditing enabled to write audit logs to Event Hub
Create SQL MI with configured sending of logs and metrics

Deploy to Azure
This template allows you to deploy SQL MI and additional resources used for storing logs and metrics (diagnostic workspace, storage account, event hub).
Create an Environment with an Event Hub Event Source

Deploy to Azure
This template enables you to deploy a Time Series Insights environment that is configured to consume events from an Event Hub.

Terraform (AzAPI provider) resource definition

The namespaces/eventhubs resource type can be deployed to:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.EventHub/namespaces/eventhubs resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.EventHub/namespaces/eventhubs@2022-01-01-preview"
  name = "string"
  parent_id = "string"
  body = jsonencode({
    properties = {
      captureDescription = {
        destination = {
          name = "string"
          properties = {
            archiveNameFormat = "string"
            blobContainer = "string"
            dataLakeAccountName = "string"
            dataLakeFolderPath = "string"
            dataLakeSubscriptionId = "string"
            storageAccountResourceId = "string"
          }
        }
        enabled = bool
        encoding = "string"
        intervalInSeconds = int
        sizeLimitInBytes = int
        skipEmptyArchives = bool
      }
      messageRetentionInDays = int
      partitionCount = int
      status = "string"
    }
  })
}

Property values

namespaces/eventhubs

Name Description Value
type The resource type "Microsoft.EventHub/namespaces/eventhubs@2022-01-01-preview"
name The resource name string (required)

Character limit: 1-256

Valid characters:
Alphanumerics, periods, hyphens and underscores.

Start and end with letter or number.
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: namespaces
properties Properties supplied to the Create Or Update Event Hub operation. EventhubProperties

EventhubProperties

Name Description Value
captureDescription Properties of capture description CaptureDescription
messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days int
partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. int
status Enumerates the possible values for the status of the Event Hub. "Active"
"Creating"
"Deleting"
"Disabled"
"ReceiveDisabled"
"Renaming"
"Restoring"
"SendDisabled"
"Unknown"

CaptureDescription

Name Description Value
destination Properties of Destination where capture will be stored. (Storage Account, Blob Names) Destination
enabled A value that indicates whether capture description is enabled. bool
encoding Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version "Avro"
"AvroDeflate"
intervalInSeconds The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds int
sizeLimitInBytes The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes int
skipEmptyArchives A value that indicates whether to Skip Empty Archives bool

Destination

Name Description Value
name Name for capture destination string
properties Properties describing the storage account, blob container and archive name format for capture destination DestinationProperties

DestinationProperties

Name Description Value
archiveNameFormat Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order string
blobContainer Blob container Name string
dataLakeAccountName The Azure Data Lake Store name for the captured events string
dataLakeFolderPath The destination folder path for the captured events string
dataLakeSubscriptionId Subscription Id of Azure Data Lake Store string
storageAccountResourceId Resource id of the storage account to be used to create the blobs string