az timeseriesinsights event-source iothub

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

Commands

az timeseriesinsights event-source iothub create

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

az timeseriesinsights event-source iothub update

Create or update an event source under the specified environment.

az timeseriesinsights event-source iothub create

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

az timeseriesinsights event-source iothub 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 iothub and use it for event source

rg={rg}
iothub={iothub_name}
es_resource_id=$(az iot hub create -g $rg -n $iothub --query id --output tsv)
shared_access_key=$(az iot hub policy list -g $rg --hub-name $iothub --query "[?keyName=='iothubowner'].primaryKey" --output tsv)
az timeseriesinsights event-source iothub create -g $rg --environment-name {env} -n es2 --consumer-group-name '$Default' --key-name iothubowner --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --timestamp-property-name DeviceId

Required Parameters

--consumer-group-name

Required. The name of the iot 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 Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot 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 Policy key that grants the Time Series Insights service read access to the iot 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 iothub update

Create or update an event source under the specified environment.

az timeseriesinsights event-source iothub 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 iothub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1

Update localTimestamp (Currently only Embedded is supported)

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

Update sharedAccessKey

az timeseriesinsights event-source iothub 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 iot 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.