Skip to main content

assignments

Creates, updates, deletes, gets or lists an assignments resource.

Overview

Nameassignments
TypeResource
Idazure.security.assignments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
additionalDataobjectAdditional data about the assignment.
assignedComponentobjectComponent item with key as applied to this standard assignment over the given scope.
assignedStandardobjectStandard item with key as applied to this standard assignment over the given scope.
descriptionstringdescription of the standardAssignment.
displayNamestringdisplay name of the standardAssignment.
effectstringexpected effect of this assignment (Disable/Exempt/etc).
etagstringEntity tag is used for comparing two or more entities from the same requested resource.
expiresOnstring (date-time)Expiration date of this assignment as a full ISO date.
kindstringKind of the resource.
locationstringThe geo-location where the resource lives.
metadataobjectThe assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
scopestringScope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, assignment_id, subscription_idGet a specific standard assignment for the requested scope by resourceId.
listselectresource_group_name, subscription_idGet a list of all relevant standardAssignments available for scope.
list_by_subscriptionselectsubscription_idGet a list of all relevant standardAssignments over a subscription level scope.
create_or_updateinsertresource_group_name, assignment_id, subscription_idCreate a security assignment on the given scope. Will create/update the required standard assignment.
create_or_updatereplaceresource_group_name, assignment_id, subscription_idCreate a security assignment on the given scope. Will create/update the required standard assignment.
deletedeleteresource_group_name, assignment_id, subscription_idDelete a standard assignment over a given scope.

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
assignment_idstringThe security assignment key - unique key for the standard assignment. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get a specific standard assignment for the requested scope by resourceId.

SELECT
id,
name,
additionalData,
assignedComponent,
assignedStandard,
description,
displayName,
effect,
etag,
expiresOn,
kind,
location,
metadata,
scope,
systemData,
tags,
type
FROM azure.security.assignments
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND assignment_id = '{{ assignment_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a security assignment on the given scope. Will create/update the required standard assignment.

INSERT INTO azure.security.assignments (
properties,
tags,
location,
kind,
etag,
resource_group_name,
assignment_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ kind }}',
'{{ etag }}',
'{{ resource_group_name }}',
'{{ assignment_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
kind,
location,
properties,
systemData,
tags,
type
;

REPLACE examples

Create a security assignment on the given scope. Will create/update the required standard assignment.

REPLACE azure.security.assignments
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
location = '{{ location }}',
kind = '{{ kind }}',
etag = '{{ etag }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND assignment_id = '{{ assignment_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
kind,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete a standard assignment over a given scope.

DELETE FROM azure.security.assignments
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND assignment_id = '{{ assignment_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;