Skip to main content

sql_role_definitions

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

Overview

Namesql_role_definitions
TypeResource
Idazure.cosmos_db.sql_role_definitions

Fields

NameDatatypeDescription
idtextThe unique resource identifier of the database account.
nametextThe name of the database account.
accountNametextfield from the properties object
assignable_scopestextfield from the properties object
permissionstextfield from the properties object
resourceGroupNametextfield from the properties object
roleDefinitionIdtextfield from the properties object
role_nametextfield from the properties object
subscriptionIdtextfield from the properties object
typetextThe type of Azure resource.

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccountName, resourceGroupName, roleDefinitionId, subscriptionIdRetrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id.
listSELECTaccountName, resourceGroupName, subscriptionIdRetrieves the list of all Azure Cosmos DB SQL Role Definitions.
create_updateINSERTaccountName, resourceGroupName, roleDefinitionId, subscriptionIdCreates or updates an Azure Cosmos DB SQL Role Definition.
deleteDELETEaccountName, resourceGroupName, roleDefinitionId, subscriptionIdDeletes an existing Azure Cosmos DB SQL Role Definition.

SELECT examples

Retrieves the list of all Azure Cosmos DB SQL Role Definitions.

SELECT
id,
name,
accountName,
assignable_scopes,
permissions,
resourceGroupName,
roleDefinitionId,
role_name,
subscriptionId,
type
FROM azure.cosmos_db.vw_sql_role_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.cosmos_db.sql_role_definitions (
accountName,
resourceGroupName,
roleDefinitionId,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ resourceGroupName }}',
'{{ roleDefinitionId }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified sql_role_definitions resource.

/*+ delete */
DELETE FROM azure.cosmos_db.sql_role_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND roleDefinitionId = '{{ roleDefinitionId }}'
AND subscriptionId = '{{ subscriptionId }}';