az iot hub message-endpoint create

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.37.0 or higher). The extension will automatically install the first time you run an az iot hub message-endpoint create command. Learn more about extensions.

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add an endpoint to an IoT Hub.

Commands

Name Description Type Status
az iot hub message-endpoint create cosmosdb-container

Add a Cosmos DB Container endpoint for an IoT Hub.

Extension Preview
az iot hub message-endpoint create eventhub

Add an Event Hub endpoint for an IoT Hub.

Extension Preview
az iot hub message-endpoint create servicebus-queue

Add a Service Bus Queue endpoint for an IoT Hub.

Extension Preview
az iot hub message-endpoint create servicebus-topic

Add a Service Bus Topic endpoint for an IoT Hub.

Extension Preview
az iot hub message-endpoint create storage-container

Add a Storage Container endpoint for an IoT Hub.

Extension Preview

az iot hub message-endpoint create cosmosdb-container

Preview

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a Cosmos DB Container endpoint for an IoT Hub.

az iot hub message-endpoint create cosmosdb-container --container
                                                      --database-name
                                                      --en
                                                      --hub-name
                                                      [--connection-string]
                                                      [--endpoint-account]
                                                      [--endpoint-resource-group]
                                                      [--endpoint-subscription-id]
                                                      [--endpoint-uri]
                                                      [--identity]
                                                      [--partition-key-name]
                                                      [--partition-key-template]
                                                      [--pk]
                                                      [--resource-group]
                                                      [--secondary-key]

Examples

Create a key-based Cosmos DB Container endpoint for an IoT Hub.

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --container {container} --db {database} --endpoint-account {account_name}

Create a Cosmos DB Container endpoint for an IoT Hub using a connection string.

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} -c {connection_string} --container {container} --db {database}

Create a Cosmos DB Container endpoint for an IoT Hub using the specified primary key and endpoint uri.

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --pk {primary_key} --endpoint-uri {endpoint_uri} --container {container} --db {database}

Create a Cosmos DB Container endpoint for an IoT Hub using system assigned identity and a partition key name. The partition key template will be the default.

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container} --db {database} --pkn {partition_key_name} --identity [system]

Create a Cosmos DB Container endpoint for an IoT Hub using user assigned identity, partition key name, and partition key template.

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container} --db {database} --pkn {partition_key_name} --pkt {partition_key_template} --identity {user_identity_resource_id}

Required Parameters

--container --container-name

The name of the Cosmos DB SQL Container in the cosmos DB Database.

--database-name --db

The name of the cosmos DB database in the cosmos DB account.

--en --endpoint --endpoint-name

Name of the routing endpoint.

--hub-name -n

IoT Hub name.

Optional Parameters

--connection-string -c

Connection string of the routing endpoint.

--endpoint-account

The account name for the endpoint resource.

--endpoint-resource-group --erg -r

Resource group of the Endpoint resoure. If not provided, the IoT Hub's resource group will be used.

--endpoint-subscription-id -s

Subscription Id of the Endpoint resource. If not provided, the IoT Hub's subscription will be used.

--endpoint-uri

The uri of the endpoint resource.

--identity

Use a system-assigned or user-assigned managed identity for endpoint authentication. Use "[system]" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--partition-key-name --pkn

The name of the partition key associated with this Cosmos DB SQL Container if one exists.

--partition-key-template --pkt

The template for generating a synthetic partition key value for use with this Cosmos DB SQL Container. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. If partition key name is provided, partition key template defaults to {deviceid}-{YYYY}-{MM}.

--pk --primary-key

The primary key of the cosmos DB account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--secondary-key --sk

The secondary key of the cosmos DB account.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot hub message-endpoint create eventhub

Preview

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add an Event Hub endpoint for an IoT Hub.

az iot hub message-endpoint create eventhub --en
                                            --hub-name
                                            [--connection-string]
                                            [--endpoint-namespace-name]
                                            [--endpoint-policy-name]
                                            [--endpoint-resource-group]
                                            [--endpoint-subscription-id]
                                            [--endpoint-uri]
                                            [--entity-path]
                                            [--identity]
                                            [--resource-group]

Examples

Create a key-based Event Hub endpoint for an IoT Hub.

az iot hub message-endpoint create eventhub -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

Create an Event Hub endpoint for an IoT Hub using a connection string. The endpoint uri and entity path are omitted.

az iot hub message-endpoint create eventhub -n {iothub_name} --en {endpoint_name} -c {connection_string}

Create an Event Hub endpoint for an IoT Hub using system assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create eventhub -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity [system]

Create an Event Hub endpoint for an IoT Hub using user assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create eventhub -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity {user_identity_resource_id}

Required Parameters

--en --endpoint --endpoint-name

Name of the routing endpoint.

--hub-name -n

IoT Hub name.

Optional Parameters

--connection-string -c

Connection string of the routing endpoint.

--endpoint-namespace-name --namespace

The namespace name for the endpoint resource.

--endpoint-policy-name --policy

The policy name for connection string retrieval.

--endpoint-resource-group --erg -r

Resource group of the Endpoint resoure. If not provided, the IoT Hub's resource group will be used.

--endpoint-subscription-id -s

Subscription Id of the Endpoint resource. If not provided, the IoT Hub's subscription will be used.

--endpoint-uri

The uri of the endpoint resource.

--entity-path

The entity path of the endpoint resource.

--identity

Use a system-assigned or user-assigned managed identity for endpoint authentication. Use "[system]" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot hub message-endpoint create servicebus-queue

Preview

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a Service Bus Queue endpoint for an IoT Hub.

az iot hub message-endpoint create servicebus-queue --en
                                                    --hub-name
                                                    [--connection-string]
                                                    [--endpoint-namespace-name]
                                                    [--endpoint-policy-name]
                                                    [--endpoint-resource-group]
                                                    [--endpoint-subscription-id]
                                                    [--endpoint-uri]
                                                    [--entity-path]
                                                    [--identity]
                                                    [--resource-group]

Examples

Create a key-based Service Bus Queue endpoint for an IoT Hub.

az iot hub message-endpoint create servicebus-queue -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

Create a Service Bus Queue endpoint for an IoT Hub using a connection string. The endpoint uri and entity path are omitted.

az iot hub message-endpoint create servicebus-queue -n {iothub_name} --en {endpoint_name} -c {connection_string}

Create a Service Bus Queue endpoint for an IoT Hub using system assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create servicebus-queue -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity [system]

Create a Service Bus Queue endpoint for an IoT Hub using user assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create servicebus-queue -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity {user_identity_resource_id}

Required Parameters

--en --endpoint --endpoint-name

Name of the routing endpoint.

--hub-name -n

IoT Hub name.

Optional Parameters

--connection-string -c

Connection string of the routing endpoint.

--endpoint-namespace-name --namespace

The namespace name for the endpoint resource.

--endpoint-policy-name --policy

The policy name for connection string retrieval.

--endpoint-resource-group --erg -r

Resource group of the Endpoint resoure. If not provided, the IoT Hub's resource group will be used.

--endpoint-subscription-id -s

Subscription Id of the Endpoint resource. If not provided, the IoT Hub's subscription will be used.

--endpoint-uri

The uri of the endpoint resource.

--entity-path

The entity path of the endpoint resource.

--identity

Use a system-assigned or user-assigned managed identity for endpoint authentication. Use "[system]" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot hub message-endpoint create servicebus-topic

Preview

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a Service Bus Topic endpoint for an IoT Hub.

az iot hub message-endpoint create servicebus-topic --en
                                                    --hub-name
                                                    [--connection-string]
                                                    [--endpoint-namespace-name]
                                                    [--endpoint-policy-name]
                                                    [--endpoint-resource-group]
                                                    [--endpoint-subscription-id]
                                                    [--endpoint-uri]
                                                    [--entity-path]
                                                    [--identity]
                                                    [--resource-group]

Examples

Create a key-based Service Bus Topic endpoint for an IoT Hub.

az iot hub message-endpoint create servicebus-topic -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

Create a Service Bus Topic endpoint for an IoT Hub using a connection string. The endpoint uri and entity path are omitted.

az iot hub message-endpoint create servicebus-topic -n {iothub_name} --en {endpoint_name} -c {connection_string}

Create a Service Bus Topic endpoint for an IoT Hub using system assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create servicebus-topic -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity [system]

Create a Service Bus Topic endpoint for an IoT Hub using user assigned identity. The endpoint and entity path must be specified.

az iot hub message-endpoint create servicebus-topic -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --entity-path {entity_path} --identity {user_identity_resource_id}

Required Parameters

--en --endpoint --endpoint-name

Name of the routing endpoint.

--hub-name -n

IoT Hub name.

Optional Parameters

--connection-string -c

Connection string of the routing endpoint.

--endpoint-namespace-name --namespace

The namespace name for the endpoint resource.

--endpoint-policy-name --policy

The policy name for connection string retrieval.

--endpoint-resource-group --erg -r

Resource group of the Endpoint resoure. If not provided, the IoT Hub's resource group will be used.

--endpoint-subscription-id -s

Subscription Id of the Endpoint resource. If not provided, the IoT Hub's subscription will be used.

--endpoint-uri

The uri of the endpoint resource.

--entity-path

The entity path of the endpoint resource.

--identity

Use a system-assigned or user-assigned managed identity for endpoint authentication. Use "[system]" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot hub message-endpoint create storage-container

Preview

Command group 'iot hub message-endpoint' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a Storage Container endpoint for an IoT Hub.

az iot hub message-endpoint create storage-container --container
                                                     --en
                                                     --hub-name
                                                     [--batch-frequency]
                                                     [--chunk-size]
                                                     [--connection-string]
                                                     [--encoding {avro, json}]
                                                     [--endpoint-account]
                                                     [--endpoint-resource-group]
                                                     [--endpoint-subscription-id]
                                                     [--endpoint-uri]
                                                     [--ff]
                                                     [--identity]
                                                     [--resource-group]

Examples

Create a key-based Storage Container endpoint for an IoT Hub.

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} --container {container_name} --endpoint-account {account_name}

Create a Storage Container endpoint for an IoT Hub using a connection string. The endpoint uri is omitted.

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} -c {connection_string} --container {container_name}

Create a Storage Container endpoint for an IoT Hub using system assigned identity with the given batch frequency, chunk size, and file name format. The endpoint must be specified.

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container_name} -b {batch_frequency} -w {chunk_size} --ff {file_format} --identity [system]

Create a Storage Container endpoint for an IoT Hub using user assigned identity with json encoding. The endpoint must be specified.

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container_name} --encoding json --identity {user_identity_resource_id}

Required Parameters

--container --container-name

Name of the storage container.

--en --endpoint --endpoint-name

Name of the routing endpoint.

--hub-name -n

IoT Hub name.

Optional Parameters

--batch-frequency -b

Request batch frequency in seconds. The maximum amount of time that can elapse before data is written to a blob, between 60 and 720 seconds.

default value: 300
--chunk-size -w

Request chunk size in megabytes(MB). The maximum size of blobs, between 10 and 500 MB.

default value: 300
--connection-string -c

Connection string of the routing endpoint.

--encoding

Encoding format for the container.

accepted values: avro, json
default value: avro
--endpoint-account

The account name for the endpoint resource.

--endpoint-resource-group --erg -r

Resource group of the Endpoint resoure. If not provided, the IoT Hub's resource group will be used.

--endpoint-subscription-id -s

Subscription Id of the Endpoint resource. If not provided, the IoT Hub's subscription will be used.

--endpoint-uri

The uri of the endpoint resource.

--ff --file-name-format

File name format for the blob. The file name format must contain {iothub}, {partition}, {YYYY}, {MM}, {DD}, {HH} and {mm} fields. All parameters are mandatory but can be reordered with or without delimiters.

default value: {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}
--identity

Use a system-assigned or user-assigned managed identity for endpoint authentication. Use "[system]" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.