az kusto script

Note

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

Manage script with kusto.

Commands

az kusto script create

Creates a Kusto database script.

az kusto script delete

Deletes a Kusto principalAssignment.

az kusto script list

Returns the list of database scripts for given database.

az kusto script show

Gets a Kusto cluster database script.

az kusto script update

Updates a database script.

az kusto script wait

Place the CLI in a waiting state until a condition of the kusto script is met.

az kusto script create

Creates a Kusto database script.

az kusto script create --cluster-name
                       --database-name
                       --name
                       --resource-group
                       [--continue-on-errors {false, true}]
                       [--force-update-tag]
                       [--no-wait]
                       [--script-content]
                       [--script-url]
                       [--script-url-sas-token]

Examples

KustoScriptsCreateOrUpdate

az kusto script create --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --continue-on-errors true --force-update-tag "2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe" --script-url "https://mysa.blob.core.windows.net/container/script.txt" --script-url-sas-token "?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************" --resource-group "kustorptest" --name "kustoScript1"

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--name --script-name -n

The name of the Kusto database script.

--resource-group -g

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

Optional Parameters

--continue-on-errors

Flag that indicates whether to continue if one of the command fails.

accepted values: false, true
--force-update-tag

A unique string. If changed the script will be applied again.

--no-wait

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

--script-content

The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with scriptUrl and scriptUrlSasToken properties.

--script-url

The url to the KQL script blob file. Must not be used together with scriptContent property.

--script-url-sas-token

The SaS token that provide read access to the file which contain the script. Must be provided when using scriptUrl property.

az kusto script delete

Deletes a Kusto principalAssignment.

az kusto script delete --cluster-name
                       --database-name
                       --name
                       --resource-group
                       [--no-wait]
                       [--yes]

Examples

KustoScriptsDelete

az kusto script delete --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --resource-group "kustorptest" --name "kustoScript1"

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--name --script-name -n

The name of the Kusto database script.

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

--yes -y

Do not prompt for confirmation.

az kusto script list

Returns the list of database scripts for given database.

az kusto script list --cluster-name
                     --database-name
                     --resource-group

Examples

KustoScriptsList

az kusto script list --cluster-name "kustoclusterrptest4" --database-name "Kustodatabase8" --resource-group "kustorptest"

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--resource-group -g

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

az kusto script show

Gets a Kusto cluster database script.

az kusto script show --cluster-name
                     --database-name
                     --name
                     --resource-group

Examples

KustoScriptsGet

az kusto script show --cluster-name "kustoclusterrptest4" --database-name "Kustodatabase8" --resource-group "kustorptest" --name "kustoScript1"

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--name --script-name -n

The name of the Kusto database script.

--resource-group -g

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

az kusto script update

Updates a database script.

az kusto script update --cluster-name
                       --database-name
                       --name
                       --resource-group
                       [--continue-on-errors {false, true}]
                       [--force-update-tag]
                       [--no-wait]
                       [--script-content]
                       [--script-url]
                       [--script-url-sas-token]

Examples

KustoScriptsUpdate

az kusto script update --cluster-name "kustoclusterrptest4" --database-name "KustoDatabase8" --continue-on-errors true --force-update-tag "2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe" --script-url "https://mysa.blob.core.windows.net/container/script.txt" --script-url-sas-token "?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************" --resource-group "kustorptest" --name "kustoScript1"

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--name --script-name -n

The name of the Kusto database script.

--resource-group -g

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

Optional Parameters

--continue-on-errors

Flag that indicates whether to continue if one of the command fails.

accepted values: false, true
--force-update-tag

A unique string. If changed the script will be applied again.

--no-wait

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

--script-content

The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with scriptUrl and scriptUrlSasToken properties.

--script-url

The url to the KQL script blob file. Must not be used together with scriptContent property.

--script-url-sas-token

The SaS token that provide read access to the file which contain the script. Must be provided when using scriptUrl property.

az kusto script wait

Place the CLI in a waiting state until a condition of the kusto script is met.

az kusto script wait --cluster-name
                     --database-name
                     --name
                     --resource-group
                     [--created]
                     [--custom]
                     [--deleted]
                     [--exists]
                     [--interval]
                     [--timeout]
                     [--updated]

Examples

Pause executing next line of CLI script until the kusto script is successfully created.

az kusto script wait --cluster-name "kustoclusterrptest4" --database-name "Kustodatabase8" --resource-group "kustorptest" --name "kustoScript1" --created

Pause executing next line of CLI script until the kusto script is successfully updated.

az kusto script wait --cluster-name "kustoclusterrptest4" --database-name "Kustodatabase8" --resource-group "kustorptest" --name "kustoScript1" --updated

Pause executing next line of CLI script until the kusto script is successfully deleted.

az kusto script wait --cluster-name "kustoclusterrptest4" --database-name "Kustodatabase8" --resource-group "kustorptest" --name "kustoScript1" --deleted

Required Parameters

--cluster-name

The name of the Kusto cluster.

--database-name

The name of the database in the Kusto cluster.

--name --script-name -n

The name of the Kusto database script.

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

--custom

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

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--interval

Polling interval in seconds.

default value: 30
--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.