role_assignments
Creates, updates, deletes, gets or lists a role_assignments resource.
Overview
| Name | role_assignments |
| Type | Resource |
| Id | azure.synapse_access_control.role_assignments |
Fields
The following fields are returned by SELECT queries:
- check_principal_access
- get_role_assignment_by_id
- list_role_assignments
| Name | Datatype | Description |
|---|---|---|
accessDecisions | array |
| Name | Datatype | Description |
|---|---|---|
id | string | |
principalId | string | |
principalType | string | |
roleDefinitionId | string | |
scope | string |
| Name | Datatype | Description |
|---|---|---|
id | string | |
principalId | string | |
principalType | string | |
roleDefinitionId | string | |
scope | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
check_principal_access | select | endpoint | Check if the given principalId has access to perform list of actions at a given scope. | |
get_role_assignment_by_id | select | role_assignment_id, endpoint | Get role assignment by role assignment Id. | |
list_role_assignments | select | endpoint | roleId, principalId, scope, x-ms-continuation | List role assignments. |
create_role_assignment | insert | endpoint | Create role assignment. | |
get_role_assignments | exec | endpoint | roleId, principalId, x-ms-continuation | List role assignments. |
delete_role_assignment_by_id | exec | role_assignment_id, endpoint | Delete role assignment by role assignment Id. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme). (default: ) |
role_assignment_id | string | The ID of the role assignment. |
principalId | string | Object ID of the AAD principal or security-group. |
roleId | string | Synapse Built-In Role Id. |
scope | string | Scope of the Synapse Built-in Role. |
x-ms-continuation | string | Continuation token. |
SELECT examples
- check_principal_access
- get_role_assignment_by_id
- list_role_assignments
Check if the given principalId has access to perform list of actions at a given scope.
SELECT
accessDecisions
FROM azure.synapse_access_control.role_assignments
WHERE endpoint = '{{ endpoint }}' -- required
;
Get role assignment by role assignment Id.
SELECT
id,
principalId,
principalType,
roleDefinitionId,
scope
FROM azure.synapse_access_control.role_assignments
WHERE role_assignment_id = '{{ role_assignment_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;
List role assignments.
SELECT
id,
principalId,
principalType,
roleDefinitionId,
scope
FROM azure.synapse_access_control.role_assignments
WHERE endpoint = '{{ endpoint }}' -- required
AND roleId = '{{ roleId }}'
AND principalId = '{{ principalId }}'
AND scope = '{{ scope }}'
AND x-ms-continuation = '{{ x-ms-continuation }}'
;
INSERT examples
- create_role_assignment
- Manifest
Create role assignment.
INSERT INTO azure.synapse_access_control.role_assignments (
endpoint
)
SELECT
'{{ endpoint }}'
RETURNING
id,
principalId,
principalType,
roleDefinitionId,
scope
;
# Description fields are for documentation purposes
- name: role_assignments
props:
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the role_assignments resource.
Lifecycle Methods
- get_role_assignments
- delete_role_assignment_by_id
List role assignments.
EXEC azure.synapse_access_control.role_assignments.get_role_assignments
@endpoint='{{ endpoint }}' --required,
@roleId='{{ roleId }}',
@principalId='{{ principalId }}',
@x-ms-continuation='{{ x-ms-continuation }}'
;
Delete role assignment by role assignment Id.
EXEC azure.synapse_access_control.role_assignments.delete_role_assignment_by_id
@role_assignment_id='{{ role_assignment_id }}' --required,
@endpoint='{{ endpoint }}' --required
;