Share via


az stream-analytics output

Note

This reference is part of the stream-analytics extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az stream-analytics output command. Learn more about extensions.

Manage output with stream analytics.

Commands

Name Description Type Status
az stream-analytics output create

Create an output or replaces an already existing output under an existing streaming job.

Extension GA
az stream-analytics output delete

Delete an output from the streaming job.

Extension GA
az stream-analytics output list

List all of the outputs under the specified streaming job.

Extension GA
az stream-analytics output show

Get details about the specified output.

Extension GA
az stream-analytics output test

Test whether an output’s datasource is reachable and usable by the Azure Stream Analytics service.

Extension GA
az stream-analytics output update

Update an existing output under an existing streaming job. This can be used to partially update (ie. update one or two properties) an output without affecting the rest the job or output definition.

Extension GA
az stream-analytics output wait

Place the CLI in a waiting state until a condition of the stream-analytics output is met.

Extension GA

az stream-analytics output create

Create an output or replaces an already existing output under an existing streaming job.

az stream-analytics output create --job-name
                                  --name
                                  --resource-group
                                  [--datasource]
                                  [--if-match]
                                  [--if-none-match]
                                  [--serialization]
                                  [--size-window]
                                  [--time-window]

Examples

Create a DocumentDB output

az stream-analytics output create --job-name "sj2331" --datasource "{\"type\":\"Microsoft.Storage/DocumentDB\",\"properties\":{\"accountId\":\"someAccountId\",\"accountKey\":\"accountKey==\",\"collectionNamePattern\":\"collection\",\"database\":\"db01\",\"documentId\":\"documentId\",\"partitionKey\":\"key\"}}" --output-name "output3022" --resource-group "sjrg7983"

Create a Power BI output

az stream-analytics output create --job-name "sj2331" --datasource "{\"type\":\"PowerBI\",\"properties\":{\"dataset\":\"someDataset\",\"groupId\":\"ac40305e-3e8d-43ac-8161-c33799f43e95\",\"groupName\":\"MyPowerBIGroup\",\"refreshToken\":\"someRefreshToken==\",\"table\":\"someTable\",\"tokenUserDisplayName\":\"Bob Smith\",\"tokenUserPrincipalName\":\"bobsmith@contoso.com\"}}" --output-name "output3022" --resource-group "sjrg7983"

Create a Service Bus Queue output with Avro serialization

az stream-analytics output create --job-name "sj5095" --datasource "{\"type\":\"Microsoft.ServiceBus/Queue\",\"properties\":{\"propertyColumns\":[\"column1\",\"column2\"],\"queueName\":\"sdkqueue\",\"serviceBusNamespace\":\"sdktest\",\"sharedAccessPolicyKey\":\"sharedAccessPolicyKey=\",\"sharedAccessPolicyName\":\"RootManageSharedAccessKey\",\"systemPropertyColumns\":{\"MessageId\":\"col3\",\"PartitionKey\":\"col4\"}}}" --serialization "{\"type\":\"Avro\"}" --output-name "output3456" --resource-group "sjrg3410"

Create a Service Bus Topic output with CSV serialization

az stream-analytics output create --job-name "sj7094" --datasource "{\"type\":\"Microsoft.ServiceBus/Topic\",\"properties\":{\"propertyColumns\":[\"column1\",\"column2\"],\"serviceBusNamespace\":\"sdktest\",\"sharedAccessPolicyKey\":\"sharedAccessPolicyKey=\",\"sharedAccessPolicyName\":\"RootManageSharedAccessKey\",\"topicName\":\"sdktopic\"}}" --serialization "{\"type\":\"Csv\",\"properties\":{\"encoding\":\"UTF8\",\"fieldDelimiter\":\",\"}}" --output-name "output7886" --resource-group "sjrg6450"

Create a blob output with CSV serialization

az stream-analytics output create --job-name "sj900" --datasource "{\"type\":\"Microsoft.Storage/Blob\",\"properties\":{\"container\":\"state\",\"dateFormat\":\"yyyy/MM/dd\",\"pathPattern\":\"{date}/{time}\",\"storageAccounts\":[{\"accountKey\":\"accountKey==\",\"accountName\":\"someAccountName\"}],\"timeFormat\":\"HH\"}}" --serialization "{\"type\":\"Csv\",\"properties\":{\"encoding\":\"UTF8\",\"fieldDelimiter\":\",\"}}" --output-name "output1623" --resource-group "sjrg5023"

Create an Azure Data Lake Store output with JSON serialization

az stream-analytics output create --job-name "sj3310" --datasource "{\"type\":\"Microsoft.DataLake/Accounts\",\"properties\":{\"accountName\":\"someaccount\",\"dateFormat\":\"yyyy/MM/dd\",\"filePathPrefix\":\"{date}/{time}\",\"refreshToken\":\"someRefreshToken==\",\"tenantId\":\"cea4e98b-c798-49e7-8c40-4a2b3beb47dd\",\"timeFormat\":\"HH\",\"tokenUserDisplayName\":\"Bob Smith\",\"tokenUserPrincipalName\":\"bobsmith@contoso.com\"}}" --serialization "{\"type\":\"Json\",\"properties\":{\"format\":\"Array\",\"encoding\":\"UTF8\"}}" --output-name "output5195" --resource-group "sjrg6912"

Create an Azure SQL database output

az stream-analytics output create --job-name "sj6458" --datasource "{\"type\":\"Microsoft.Sql/Server/Database\",\"properties\":{\"database\":\"someDatabase\",\"password\":\"somePassword\",\"server\":\"someServer\",\"table\":\"someTable\",\"user\":\"<user>\"}}" --output-name "output1755" --resource-group "sjrg2157"

Create an Azure Table output

az stream-analytics output create --job-name "sj2790" --datasource "{\"type\":\"Microsoft.Storage/Table\",\"properties\":{\"accountKey\":\"accountKey==\",\"accountName\":\"someAccountName\",\"batchSize\":25,\"columnsToRemove\":[\"column1\",\"column2\"],\"partitionKey\":\"partitionKey\",\"rowKey\":\"rowKey\",\"table\":\"samples\"}}" --output-name "output958" --resource-group "sjrg5176"

Create an Event Hub output with JSON serialization

az stream-analytics output create --job-name "sj3310" --datasource "{\"type\":\"Microsoft.ServiceBus/EventHub\",\"properties\":{\"eventHubName\":\"sdkeventhub\",\"partitionKey\":\"partitionKey\",\"serviceBusNamespace\":\"sdktest\",\"sharedAccessPolicyKey\":\"sharedAccessPolicyKey=\",\"sharedAccessPolicyName\":\"RootManageSharedAccessKey\"}}" --serialization "{\"type\":\"Json\",\"properties\":{\"format\":\"Array\",\"encoding\":\"UTF8\"}}" --output-name "output5195" --resource-group "sjrg6912"

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--resource-group -g

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

Optional Parameters

--datasource

Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--if-match

The ETag of the output. Omit this value to always overwrite the current output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.

--if-none-match

Set to '*' to allow a new output to be created, but to prevent updating an existing output. Other values will result in a 412 Pre-condition Failed response.

--serialization

Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--size-window

The size window to constrain a Stream Analytics output to.

--time-window

The time frame for filtering Stream Analytics job outputs.

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 stream-analytics output delete

Delete an output from the streaming job.

az stream-analytics output delete --job-name
                                  --name
                                  --resource-group
                                  [--yes]

Examples

Delete an output

az stream-analytics output delete --job-name "sj6458" --name "output1755" --resource-group "sjrg2157"

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--resource-group -g

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

Optional Parameters

--yes -y

Do not prompt for confirmation.

Default value: False
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 stream-analytics output list

List all of the outputs under the specified streaming job.

az stream-analytics output list --job-name
                                --resource-group
                                [--select]

Examples

List all outputs in a streaming job

az stream-analytics output list --job-name "sj6458" --resource-group "sjrg2157"

Required Parameters

--job-name

The name of the streaming job.

--resource-group -g

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

Optional Parameters

--select

The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or "" to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '' as a valid value.

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 stream-analytics output show

Get details about the specified output.

az stream-analytics output show --job-name
                                --name
                                --resource-group

Examples

Get a DocumentDB output

az stream-analytics output show --job-name "sj2331" --output-name "output3022" --resource-group "sjrg7983"

Get a Power BI output

az stream-analytics output show --job-name "sj2331" --output-name "output3022" --resource-group "sjrg7983"

Get a Service Bus Queue output with Avro serialization

az stream-analytics output show --job-name "sj5095" --output-name "output3456" --resource-group "sjrg3410"

Get a Service Bus Topic output with CSV serialization

az stream-analytics output show --job-name "sj7094" --output-name "output7886" --resource-group "sjrg6450"

Get a blob output with CSV serialization

az stream-analytics output show --job-name "sj900" --output-name "output1623" --resource-group "sjrg5023"

Get an Azure Data Lake Store output with JSON serialization

az stream-analytics output show --job-name "sj3310" --output-name "output5195" --resource-group "sjrg6912"

Get an Azure Data Warehouse output

az stream-analytics output show --job-name "sjName" --output-name "output958" --resource-group "sjrg"

Get an Azure SQL database output

az stream-analytics output show --job-name "sj6458" --output-name "output1755" --resource-group "sjrg2157"

Get an Azure Table output

az stream-analytics output show --job-name "sj2790" --output-name "output958" --resource-group "sjrg5176"

Get an Event Hub output with JSON serialization

az stream-analytics output show --job-name "sj3310" --output-name "output5195" --resource-group "sjrg6912"

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--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 stream-analytics output test

Test whether an output’s datasource is reachable and usable by the Azure Stream Analytics service.

az stream-analytics output test --job-name
                                --name
                                --resource-group
                                [--datasource]
                                [--no-wait]
                                [--serialization]
                                [--size-window]
                                [--time-window]

Examples

Test the connection for an output

az stream-analytics output test --job-name "sj6458" --output-name "output1755" --resource-group "sjrg2157"

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--resource-group -g

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

Optional Parameters

--datasource

Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--serialization

Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--size-window

The size window to constrain a Stream Analytics output to.

--time-window

The time frame for filtering Stream Analytics job outputs.

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 stream-analytics output update

Update an existing output under an existing streaming job. This can be used to partially update (ie. update one or two properties) an output without affecting the rest the job or output definition.

az stream-analytics output update --job-name
                                  --name
                                  --resource-group
                                  [--datasource]
                                  [--if-match]
                                  [--serialization]
                                  [--size-window]
                                  [--time-window]

Examples

Update a DocumentDB output

az stream-analytics output update --job-name "sj2331" --datasource "{\"type\":\"Microsoft.Storage/DocumentDB\",\"properties\":{\"partitionKey\":\"differentPartitionKey\"}}" --output-name "output3022" --resource-group "sjrg7983"

Update a Power BI output

az stream-analytics output update --job-name "sj2331" --datasource "{\"type\":\"PowerBI\",\"properties\":{\"dataset\":\"differentDataset\"}}" --output-name "output3022" --resource-group "sjrg7983"

Update a Service Bus Queue output with Avro serialization

az stream-analytics output update --job-name "sj5095" --datasource "{\"type\":\"Microsoft.ServiceBus/Queue\",\"properties\":{\"queueName\":\"differentQueueName\"}}" --serialization "{\"type\":\"Json\",\"properties\":{\"format\":\"LineSeparated\",\"encoding\":\"UTF8\"}}" --output-name "output3456" --resource-group "sjrg3410"

Update a Service Bus Topic output with CSV serialization

az stream-analytics output update --job-name "sj7094" --datasource "{\"type\":\"Microsoft.ServiceBus/Topic\",\"properties\":{\"topicName\":\"differentTopicName\"}}" --serialization "{\"type\":\"Csv\",\"properties\":{\"encoding\":\"UTF8\",\"fieldDelimiter\":\"|\"}}" --output-name "output7886" --resource-group "sjrg6450"

Update a blob output with CSV serialization

az stream-analytics output update --job-name "sj900" --datasource "{\"type\":\"Microsoft.Storage/Blob\",\"properties\":{\"container\":\"differentContainer\"}}" --serialization "{\"type\":\"Csv\",\"properties\":{\"encoding\":\"UTF8\",\"fieldDelimiter\":\"|\"}}" --output-name "output1623" --resource-group "sjrg5023"

Update an Azure Data Lake Store output with JSON serialization

az stream-analytics output update --job-name "sj3310" --datasource "{\"type\":\"Microsoft.DataLake/Accounts\",\"properties\":{\"accountName\":\"differentaccount\"}}" --serialization "{\"type\":\"Json\",\"properties\":{\"format\":\"LineSeparated\",\"encoding\":\"UTF8\"}}" --output-name "output5195" --resource-group "sjrg6912"

Update an Azure SQL database output

az stream-analytics output update --job-name "sj6458" --datasource "{\"type\":\"Microsoft.Sql/Server/Database\",\"properties\":{\"table\":\"differentTable\"}}" --output-name "output1755" --resource-group "sjrg2157"

Update an Azure Table output

az stream-analytics output update --job-name "sj2790" --datasource "{\"type\":\"Microsoft.Storage/Table\",\"properties\":{\"partitionKey\":\"differentPartitionKey\"}}" --output-name "output958" --resource-group "sjrg5176"

Update an Event Hub output with JSON serialization

az stream-analytics output update --job-name "sj3310" --datasource "{\"type\":\"Microsoft.ServiceBus/EventHub\",\"properties\":{\"partitionKey\":\"differentPartitionKey\"}}" --serialization "{\"type\":\"Json\",\"properties\":{\"format\":\"LineSeparated\",\"encoding\":\"UTF8\"}}" --output-name "output5195" --resource-group "sjrg6912"

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--resource-group -g

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

Optional Parameters

--datasource

Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--if-match

The ETag of the output. Omit this value to always overwrite the current output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.

--serialization

Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. Expected value: json-string/json-file/@json-file.

--size-window

The size window to constrain a Stream Analytics output to.

--time-window

The time frame for filtering Stream Analytics job outputs.

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 stream-analytics output wait

Place the CLI in a waiting state until a condition of the stream-analytics output is met.

az stream-analytics output wait --job-name
                                --name
                                --resource-group
                                [--created]
                                [--custom]
                                [--deleted]
                                [--exists]
                                [--interval]
                                [--timeout]
                                [--updated]

Examples

Pause executing next line of CLI script until the stream-analytics output is successfully created.

az stream-analytics output wait --job-name "sj3310" --output-name "output5195" --resource-group "sjrg6912" --created

Required Parameters

--job-name

The name of the streaming job.

--name --output-name -n

The name of the output.

--resource-group -g

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

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
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.