Skip to main content

databases

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

Overview

Namedatabases
TypeResource
Idazure.data_explorer.databases

Fields

NameDatatypeDescription
kindstringKind of the database
locationstringResource location.

Methods

NameAccessible byRequired ParamsDescription
getSELECTclusterName, databaseName, resourceGroupName, subscriptionIdReturns a database.
list_by_clusterSELECTclusterName, resourceGroupName, subscriptionIdReturns the list of databases of the given Kusto cluster.
create_or_updateINSERTclusterName, databaseName, resourceGroupName, subscriptionId, data__kindCreates or updates a database.
deleteDELETEclusterName, databaseName, resourceGroupName, subscriptionIdDeletes the database with the given name.
updateUPDATEclusterName, databaseName, resourceGroupName, subscriptionId, data__kindUpdates a database.
add_principalsEXECclusterName, databaseName, resourceGroupName, subscriptionIdAdd Database principals permissions.
check_name_availabilityEXECclusterName, resourceGroupName, subscriptionId, data__name, data__typeChecks that the databases resource name is valid and is not already in use.
invite_followerEXECclusterName, databaseName, resourceGroupName, subscriptionId, data__inviteeEmailGenerates an invitation token that allows attaching a follower database to this database.
remove_principalsEXECclusterName, databaseName, resourceGroupName, subscriptionIdRemove Database principals permissions.

SELECT examples

Returns the list of databases of the given Kusto cluster.

SELECT
kind,
location
FROM azure.data_explorer.databases
WHERE clusterName = '{{ clusterName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.data_explorer.databases (
clusterName,
databaseName,
resourceGroupName,
subscriptionId,
data__kind,
location,
kind
)
SELECT
'{{ clusterName }}',
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__kind }}',
'{{ location }}',
'{{ kind }}'
;

UPDATE example

Updates a databases resource.

/*+ update */
UPDATE azure.data_explorer.databases
SET
location = '{{ location }}',
kind = '{{ kind }}'
WHERE
clusterName = '{{ clusterName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND data__kind = '{{ data__kind }}';

DELETE example

Deletes the specified databases resource.

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