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

The following fields are returned by SELECT queries:

OK - Returns information about the role definition.

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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, roleDefinitionIdGet role definition by ID (GUID).
listselectscope$filterGet all role definitions that are applicable at scope and above.
create_or_updateinsertscope, roleDefinitionIdCreates or updates a role definition.
deletedeletescope, roleDefinitionIdDeletes a role definition.

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.

NameDatatypeDescription
roleDefinitionIdstringThe ID of the role definition to delete.
scopestringThe scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
$filterstringThe filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well.

SELECT examples

Get role definition by ID (GUID).

SELECT
id,
name,
properties,
type
FROM azure.authorization.role_definitions
WHERE scope = '{{ scope }}' -- required
AND roleDefinitionId = '{{ roleDefinitionId }}' -- required
;

INSERT examples

Creates or updates a role definition.

INSERT INTO azure.authorization.role_definitions (
data__properties,
scope,
roleDefinitionId
)
SELECT
'{{ properties }}',
'{{ scope }}',
'{{ roleDefinitionId }}'
RETURNING
id,
name,
properties,
type
;

DELETE examples

Deletes a role definition.

DELETE FROM azure.authorization.role_definitions
WHERE scope = '{{ scope }}' --required
AND roleDefinitionId = '{{ roleDefinitionId }}' --required
;