Skip to main content

role_assignments

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

Overview

Namerole_assignments
TypeResource
Idazure.authorization.role_assignments

Fields

NameDatatypeDescription
idstringThe role assignment ID.
namestringThe role assignment name.
propertiesobjectRole assignment properties.
typestringThe role assignment type.

Methods

NameAccessible byRequired ParamsDescription
getSELECTroleAssignmentName, scopeGet a role assignment by scope and name.
get_by_idSELECTroleAssignmentIdGet a role assignment by ID.
list_for_resourceSELECTresourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionIdList all role assignments that apply to a resource.
list_for_resource_groupSELECTresourceGroupName, subscriptionIdList all role assignments that apply to a resource group.
list_for_scopeSELECTscopeList all role assignments that apply to a scope.
list_for_subscriptionSELECTsubscriptionIdList all role assignments that apply to a subscription.
createINSERTroleAssignmentName, scope, data__propertiesCreate or update a role assignment by scope and name.
create_by_idINSERTroleAssignmentId, data__propertiesCreate or update a role assignment by ID.
deleteDELETEroleAssignmentName, scopeDelete a role assignment by scope and name.
delete_by_idDELETEroleAssignmentIdDelete 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.

/*+ create */
INSERT INTO azure.authorization.role_assignments (
roleAssignmentId,
data__properties,
properties
)
SELECT
'{{ roleAssignmentId }}',
'{{ data__properties }}',
'{{ properties }}'
;

DELETE example

Deletes the specified role_assignments resource.

/*+ delete */
DELETE FROM azure.authorization.role_assignments
WHERE roleAssignmentId = '{{ roleAssignmentId }}';