az timeseriesinsights event-source eventhub

Create or update an event hub event source under the specified environment.

Commands

az timeseriesinsights event-source eventhub create

Create or update an event hub event source under the specified environment.

az timeseriesinsights event-source eventhub update

Create or update an event source under the specified environment.

az timeseriesinsights event-source eventhub create

Create or update an event hub event source under the specified environment.

az timeseriesinsights event-source eventhub create --consumer-group-name
                                                   --environment-name
                                                   --event-source-resource-id
                                                   --key-name
                                                   --name
                                                   --resource-group
                                                   --shared-access-key
                                                   [--location]
                                                   [--tags]
                                                   [--timestamp-property-name]

Examples

Create an eventhub and use it for event source

rg={rg}
ehns={eventhub_namespace}
eh={eventhub_name}
az eventhubs namespace create -g $rg -n $ehns
es_resource_id=$(az eventhubs eventhub create -g $rg -n $eh --namespace-name $ehns --query id --output tsv)
shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rg --namespace-name $ehns -n RootManageSharedAccessKey --query primaryKey --output tsv)
az timeseriesinsights event-source eventhub create -g $rg --environment-name {env} -n es1 --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --timestamp-property-name DeviceId

Required Parameters

--consumer-group-name

Required. The name of the event hub's consumer group that holds the partitions from which events will be read.

--environment-name

The name of the Time Series Insights environment associated with the specified resource group.

--event-source-resource-id

Required. The resource id of the event source in Azure Resource Manager.

--key-name

Required. The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub.

--name -n

The name of the Time Series Insights event source associated with the specified environment.

--resource-group -g

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

--shared-access-key

Required. The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses.

Optional Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--timestamp-property-name

The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used.

az timeseriesinsights event-source eventhub update

Create or update an event source under the specified environment.

az timeseriesinsights event-source eventhub update --environment-name
                                                   --name
                                                   --resource-group
                                                   [--local-timestamp-format {Embedded, Iana, TimeSpan}]
                                                   [--shared-access-key]
                                                   [--tags]
                                                   [--timestamp-property-name]

Examples

Update timestampPropertyName

az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1

Update localTimestamp (Currently only Embedded is supported)

az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --local-timestamp-format Embedded

Update sharedAccessKey

az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --shared-access-key {shared_access_key}

Required Parameters

--environment-name

The name of the Time Series Insights environment associated with the specified resource group.

--name -n

The name of the Time Series Insights event source associated with the specified environment.

--resource-group -g

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

Optional Parameters

--local-timestamp-format

An enum that represents the format of the local timestamp property that needs to be set. Currently only Embedded is supported.

accepted values: Embedded, Iana, TimeSpan
--shared-access-key

The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--timestamp-property-name

The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used.