role_assignments
Creates, updates, deletes, gets or lists a role_assignments
resource.
Overview
Name | role_assignments |
Type | Resource |
Id | azure.authorization.role_assignments |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The role assignment ID. |
name | string | The role assignment name. |
properties | object | Role assignment properties. |
type | string | The role assignment type. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | roleAssignmentName, scope | Get a role assignment by scope and name. |
get_by_id | SELECT | roleAssignmentId | Get a role assignment by ID. |
list_for_resource | SELECT | resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionId | List all role assignments that apply to a resource. |
list_for_resource_group | SELECT | resourceGroupName, subscriptionId | List all role assignments that apply to a resource group. |
list_for_scope | SELECT | scope | List all role assignments that apply to a scope. |
list_for_subscription | SELECT | subscriptionId | List all role assignments that apply to a subscription. |
create | INSERT | roleAssignmentName, scope, data__properties | Create or update a role assignment by scope and name. |
create_by_id | INSERT | roleAssignmentId, data__properties | Create or update a role assignment by ID. |
delete | DELETE | roleAssignmentName, scope | Delete a role assignment by scope and name. |
delete_by_id | DELETE | roleAssignmentId | Delete a role assignment by ID. |
SELECT
examples
List all role assignments that apply to a scope.
SELECT
id,
name,
properties,
type
FROM azure.authorization.role_assignments
WHERE scope = '{{ scope }}';
INSERT
example
Use the following StackQL query and manifest file to create a new role_assignments
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.authorization.role_assignments (
roleAssignmentId,
data__properties,
properties
)
SELECT
'{{ roleAssignmentId }}',
'{{ data__properties }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: scope
value: string
- name: roleDefinitionId
value: string
- name: principalId
value: string
- name: principalType
value: string
- name: description
value: string
- name: condition
value: string
- name: conditionVersion
value: string
- name: createdOn
value: string
- name: updatedOn
value: string
- name: createdBy
value: string
- name: updatedBy
value: string
- name: delegatedManagedIdentityResourceId
value: string
DELETE
example
Deletes the specified role_assignments
resource.
/*+ delete */
DELETE FROM azure.authorization.role_assignments
WHERE roleAssignmentId = '{{ roleAssignmentId }}';