az stream-analytics function

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 function command. Learn more about extensions.

Manage function with stream analytics.

Commands

Name Description Type Status
az stream-analytics function create

Create a function or replaces an already existing function under an existing streaming job.

Extension GA
az stream-analytics function delete

Delete a function from the streaming job.

Extension GA
az stream-analytics function inspect

Retrieve the default definition of a function based on the parameters specified.

Extension GA
az stream-analytics function list

List all of the functions under the specified streaming job.

Extension GA
az stream-analytics function show

Get details about the specified function.

Extension GA
az stream-analytics function test

Test if the information provided for a function is valid. This can range from testing the connection to the underlying web service behind the function or making sure the function code provided is syntactically correct.

Extension GA
az stream-analytics function update

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

Extension GA
az stream-analytics function wait

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

Extension GA

az stream-analytics function create

Create a function or replaces an already existing function under an existing streaming job.

az stream-analytics function create --function-name
                                    --job-name
                                    --resource-group
                                    [--if-match]
                                    [--if-none-match]
                                    [--properties]

Examples

Create a JavaScript function

az stream-analytics function create --properties "{\"type\":\"Scalar\",\"properties\":{\"binding\":{\"type\":\"Microsoft.StreamAnalytics/JavascriptUdf\",\"properties\":{\"script\":\"function (x, y) { return x + y; }\"}},\"inputs\":[{\"dataType\":\"Any\"}],\"output\":{\"dataType\":\"Any\"}}}" --function-name "function8197" --job-name "sj8653" --resource-group "sjrg1637"

Create an Azure ML function

az stream-analytics function create --properties "{\"type\":\"Scalar\",\"properties\":{\"binding\":{\"type\":\"Microsoft.MachineLearning/WebService\",\"properties\":{\"apiKey\":\"someApiKey==\",\"batchSize\":1000,\"endpoint\":\"someAzureMLEndpointURL\",\"inputs\":{\"name\":\"input1\",\"columnNames\":[{\"name\":\"tweet\",\"dataType\":\"string\",\"mapTo\":0}]},\"outputs\":[{\"name\":\"Sentiment\",\"dataType\":\"string\"}]}},\"inputs\":[{\"dataType\":\"nvarchar(max)\"}],\"output\":{\"dataType\":\"nvarchar(max)\"}}}" --function-name "function588" --job-name "sj9093" --resource-group "sjrg7"

Required Parameters

--function-name --name -n

The name of the function.

--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

--if-match

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

--if-none-match

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

--properties

The properties that are associated with a function. Expected value: json-string/json-file/@json-file.

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 function delete

Delete a function from the streaming job.

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

Examples

Delete a function

az stream-analytics function delete --name "function8197" --job-name "sj8653" --resource-group "sjrg1637"

Required Parameters

--function-name --name -n

The name of the function.

--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

--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 function inspect

Retrieve the default definition of a function based on the parameters specified.

az stream-analytics function inspect --function-name
                                     --job-name
                                     --resource-group
                                     [--ml-properties]

Required Parameters

--function-name --name -n

The name of the function.

--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

--ml-properties

The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.

Usage: --ml-properties execute-endpoint=XX

execute-endpoint: The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/stream-analytics/machine-learning-udf.

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 function list

List all of the functions under the specified streaming job.

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

Examples

List all functions in a streaming job

az stream-analytics function list --job-name "sj8653" --resource-group "sjrg1637"

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 function show

Get details about the specified function.

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

Examples

Get a JavaScript function

az stream-analytics function show --name "function8197" --job-name "sj8653" --resource-group "sjrg1637"

Get an Azure ML function

az stream-analytics function show --name "function588" --job-name "sj9093" --resource-group "sjrg7"

Required Parameters

--function-name --name -n

The name of the function.

--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>.

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 function test

Test if the information provided for a function is valid. This can range from testing the connection to the underlying web service behind the function or making sure the function code provided is syntactically correct.

az stream-analytics function test --function-name
                                  --job-name
                                  --resource-group
                                  [--no-wait]
                                  [--properties]

Examples

Test the connection for a JavaScript function

az stream-analytics function test --function-name "function8197" --job-name "sj8653" --resource-group "sjrg1637"

Test the connection for an Azure ML function

az stream-analytics function test --function-name "function588" --job-name "sj9093" --resource-group "sjrg7"

Required Parameters

--function-name --name -n

The name of the function.

--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

--no-wait

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

default value: False
--properties

The properties that are associated with a function. Expected value: json-string/json-file/@json-file.

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 function update

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

az stream-analytics function update --function-name
                                    --job-name
                                    --resource-group
                                    [--if-match]
                                    [--properties]

Examples

Update a JavaScript function

az stream-analytics function update --properties "{\"type\":\"Scalar\",\"properties\":{\"binding\":{\"type\":\"Microsoft.StreamAnalytics/JavascriptUdf\",\"properties\":{\"script\":\"function (a, b) { return a * b; }\"}}}}" --function-name "function8197" --job-name "sj8653" --resource-group "sjrg1637"

Update an Azure ML function

az stream-analytics function update --properties "{\"type\":\"Scalar\",\"properties\":{\"binding\":{\"type\":\"Microsoft.MachineLearning/WebService\",\"properties\":{\"batchSize\":5000}}}}" --function-name "function588" --job-name "sj9093" --resource-group "sjrg7"

Required Parameters

--function-name --name -n

The name of the function.

--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

--if-match

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

--properties

The properties that are associated with a function. Expected value: json-string/json-file/@json-file.

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 function wait

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

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

Examples

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

az stream-analytics function wait --name "function588" --job-name "sj9093" --resource-group "sjrg7" --created

Required Parameters

--function-name --name -n

The name of the function.

--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

--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.