sql_role_assignments
Creates, updates, deletes, gets or lists a sql_role_assignments
resource.
Overview
Name | sql_role_assignments |
Type | Resource |
Id | azure.cosmos_db.sql_role_assignments |
Fields
- vw_sql_role_assignments
- sql_role_assignments
Name | Datatype | Description |
---|---|---|
id | text | The unique resource identifier of the database account. |
name | text | The name of the database account. |
accountName | text | field from the properties object |
principal_id | text | field from the properties object |
resourceGroupName | text | field from the properties object |
roleAssignmentId | text | field from the properties object |
role_definition_id | text | field from the properties object |
scope | text | field from the properties object |
subscriptionId | text | field from the properties object |
type | text | The type of Azure resource. |
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the database account. |
name | string | The name of the database account. |
properties | object | Azure Cosmos DB SQL Role Assignment resource object. |
type | string | The type of Azure resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | accountName, resourceGroupName, roleAssignmentId, subscriptionId | Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. |
list | SELECT | accountName, resourceGroupName, subscriptionId | Retrieves the list of all Azure Cosmos DB SQL Role Assignments. |
create_update | INSERT | accountName, resourceGroupName, roleAssignmentId, subscriptionId | Creates or updates an Azure Cosmos DB SQL Role Assignment. |
delete | DELETE | accountName, resourceGroupName, roleAssignmentId, subscriptionId | Deletes an existing Azure Cosmos DB SQL Role Assignment. |
SELECT
examples
Retrieves the list of all Azure Cosmos DB SQL Role Assignments.
- vw_sql_role_assignments
- sql_role_assignments
SELECT
id,
name,
accountName,
principal_id,
resourceGroupName,
roleAssignmentId,
role_definition_id,
scope,
subscriptionId,
type
FROM azure.cosmos_db.vw_sql_role_assignments
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
properties,
type
FROM azure.cosmos_db.sql_role_assignments
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_assignments
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.cosmos_db.sql_role_assignments (
accountName,
resourceGroupName,
roleAssignmentId,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ resourceGroupName }}',
'{{ roleAssignmentId }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: roleDefinitionId
value: string
- name: scope
value: string
- name: principalId
value: string
DELETE
example
Deletes the specified sql_role_assignments
resource.
/*+ delete */
DELETE FROM azure.cosmos_db.sql_role_assignments
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND roleAssignmentId = '{{ roleAssignmentId }}'
AND subscriptionId = '{{ subscriptionId }}';