Skip to main content

role_definitions

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

Overview

Namerole_definitions
TypeResource
Idazure.authorization.role_definitions

Fields

NameDatatypeDescription
idtextThe role definition ID.
nametextThe role definition name.
descriptiontextfield from the properties object
assignable_scopestextfield from the properties object
created_bytextfield from the properties object
created_ontextfield from the properties object
permissionstextfield from the properties object
roleDefinitionIdtextfield from the properties object
role_nametextfield from the properties object
scopetextfield from the properties object
typetextThe role definition type.
updated_bytextfield from the properties object
updated_ontextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTroleDefinitionId, scopeGet role definition by ID (GUID).
listSELECTscopeGet all role definitions that are applicable at scope and above.
create_or_updateINSERTroleDefinitionId, scopeCreates or updates a role definition.
deleteDELETEroleDefinitionId, scopeDeletes a role definition.

SELECT examples

Get all role definitions that are applicable at scope and above.

SELECT
id,
name,
description,
assignable_scopes,
created_by,
created_on,
permissions,
roleDefinitionId,
role_name,
scope,
type,
updated_by,
updated_on
FROM azure.authorization.vw_role_definitions
WHERE scope = '{{ scope }}';

INSERT example

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

/*+ create */
INSERT INTO azure.authorization.role_definitions (
roleDefinitionId,
scope,
properties
)
SELECT
'{{ roleDefinitionId }}',
'{{ scope }}',
'{{ properties }}'
;

DELETE example

Deletes the specified role_definitions resource.

/*+ delete */
DELETE FROM azure.authorization.role_definitions
WHERE roleDefinitionId = '{{ roleDefinitionId }}'
AND scope = '{{ scope }}';