scripts
Creates, updates, deletes, gets or lists a scripts
resource.
Overview
Name | scripts |
Type | Resource |
Id | azure.data_explorer.scripts |
Fields
- vw_scripts
- scripts
Name | Datatype | Description |
---|---|---|
clusterName | text | field from the properties object |
continue_on_errors | text | field from the properties object |
databaseName | text | field from the properties object |
force_update_tag | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
scriptName | text | field from the properties object |
script_content | text | field from the properties object |
script_url | text | field from the properties object |
script_url_sas_token | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | A class representing database script property. |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | clusterName, databaseName, resourceGroupName, scriptName, subscriptionId | Gets a Kusto cluster database script. |
list_by_database | SELECT | clusterName, databaseName, resourceGroupName, subscriptionId | Returns the list of database scripts for given database. |
create_or_update | INSERT | clusterName, databaseName, resourceGroupName, scriptName, subscriptionId | Creates a Kusto database script. |
delete | DELETE | clusterName, databaseName, resourceGroupName, scriptName, subscriptionId | Deletes a Kusto database script. |
update | UPDATE | clusterName, databaseName, resourceGroupName, scriptName, subscriptionId | Updates a database script. |
check_name_availability | EXEC | clusterName, databaseName, resourceGroupName, subscriptionId, data__name, data__type | Checks that the script name is valid and is not already in use. |
SELECT
examples
Returns the list of database scripts for given database.
- vw_scripts
- scripts
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 }}';
SELECT
properties,
systemData
FROM azure.data_explorer.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.data_explorer.scripts (
clusterName,
databaseName,
resourceGroupName,
scriptName,
subscriptionId,
properties
)
SELECT
'{{ clusterName }}',
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ scriptName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: scriptUrl
value: string
- name: scriptUrlSasToken
value: string
- name: scriptContent
value: string
- name: forceUpdateTag
value: string
- name: continueOnErrors
value: boolean
- name: provisioningState
value: []
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
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 }}';