Skip to main content

scripts

Creates, updates, deletes, gets or lists a scripts resource.

Overview

Namescripts
TypeResource
Idazure.data_explorer.scripts

Fields

NameDatatypeDescription
clusterNametextfield from the properties object
continue_on_errorstextfield from the properties object
databaseNametextfield from the properties object
force_update_tagtextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
scriptNametextfield from the properties object
script_contenttextfield from the properties object
script_urltextfield from the properties object
script_url_sas_tokentextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTclusterName, databaseName, resourceGroupName, scriptName, subscriptionIdGets a Kusto cluster database script.
list_by_databaseSELECTclusterName, databaseName, resourceGroupName, subscriptionIdReturns the list of database scripts for given database.
create_or_updateINSERTclusterName, databaseName, resourceGroupName, scriptName, subscriptionIdCreates a Kusto database script.
deleteDELETEclusterName, databaseName, resourceGroupName, scriptName, subscriptionIdDeletes a Kusto database script.
updateUPDATEclusterName, databaseName, resourceGroupName, scriptName, subscriptionIdUpdates a database script.
check_name_availabilityEXECclusterName, databaseName, resourceGroupName, subscriptionId, data__name, data__typeChecks that the script name is valid and is not already in use.

SELECT examples

Returns the list of database scripts for given database.

SELECT
clusterName,
continue_on_errors,
databaseName,
force_update_tag,
provisioning_state,
resourceGroupName,
scriptName,
script_content,
script_url,
script_url_sas_token,
subscriptionId,
system_data
FROM azure.data_explorer.vw_scripts
WHERE clusterName = '{{ clusterName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new scripts resource.

/*+ create */
INSERT INTO azure.data_explorer.scripts (
clusterName,
databaseName,
resourceGroupName,
scriptName,
subscriptionId,
properties
)
SELECT
'{{ clusterName }}',
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ scriptName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

UPDATE example

Updates a scripts resource.

/*+ update */
UPDATE azure.data_explorer.scripts
SET
properties = '{{ properties }}'
WHERE
clusterName = '{{ clusterName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND scriptName = '{{ scriptName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified scripts resource.

/*+ delete */
DELETE FROM azure.data_explorer.scripts
WHERE clusterName = '{{ clusterName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND scriptName = '{{ scriptName }}'
AND subscriptionId = '{{ subscriptionId }}';