assignments
Creates, updates, deletes, gets or lists an assignments resource.
Overview
| Name | assignments |
| Type | Resource |
| Id | azure.security.assignments |
Fields
The following fields are returned by SELECT queries:
- get
- list
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
additionalData | object | Additional data about the assignment. |
assignedComponent | object | Component item with key as applied to this standard assignment over the given scope. |
assignedStandard | object | Standard item with key as applied to this standard assignment over the given scope. |
description | string | description of the standardAssignment. |
displayName | string | display name of the standardAssignment. |
effect | string | expected effect of this assignment (Disable/Exempt/etc). |
etag | string | Entity tag is used for comparing two or more entities from the same requested resource. |
expiresOn | string (date-time) | Expiration date of this assignment as a full ISO date. |
kind | string | Kind of the resource. |
location | string | The geo-location where the resource lives. |
metadata | object | The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. |
scope | string | Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
additionalData | object | Additional data about the assignment. |
assignedComponent | object | Component item with key as applied to this standard assignment over the given scope. |
assignedStandard | object | Standard item with key as applied to this standard assignment over the given scope. |
description | string | description of the standardAssignment. |
displayName | string | display name of the standardAssignment. |
effect | string | expected effect of this assignment (Disable/Exempt/etc). |
etag | string | Entity tag is used for comparing two or more entities from the same requested resource. |
expiresOn | string (date-time) | Expiration date of this assignment as a full ISO date. |
kind | string | Kind of the resource. |
location | string | The geo-location where the resource lives. |
metadata | object | The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. |
scope | string | Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
additionalData | object | Additional data about the assignment. |
assignedComponent | object | Component item with key as applied to this standard assignment over the given scope. |
assignedStandard | object | Standard item with key as applied to this standard assignment over the given scope. |
description | string | description of the standardAssignment. |
displayName | string | display name of the standardAssignment. |
effect | string | expected effect of this assignment (Disable/Exempt/etc). |
etag | string | Entity tag is used for comparing two or more entities from the same requested resource. |
expiresOn | string (date-time) | Expiration date of this assignment as a full ISO date. |
kind | string | Kind of the resource. |
location | string | The geo-location where the resource lives. |
metadata | object | The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. |
scope | string | Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, assignment_id, subscription_id | Get a specific standard assignment for the requested scope by resourceId. | |
list | select | resource_group_name, subscription_id | Get a list of all relevant standardAssignments available for scope. | |
list_by_subscription | select | subscription_id | Get a list of all relevant standardAssignments over a subscription level scope. | |
create_or_update | insert | resource_group_name, assignment_id, subscription_id | Create a security assignment on the given scope. Will create/update the required standard assignment. | |
create_or_update | replace | resource_group_name, assignment_id, subscription_id | Create a security assignment on the given scope. Will create/update the required standard assignment. | |
delete | delete | resource_group_name, assignment_id, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
assignment_id | string | The security assignment key - unique key for the standard assignment. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
- list_by_subscription
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
;
Get a list of all relevant standardAssignments available for scope.
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 subscription_id = '{{ subscription_id }}' -- required
;
Get a list of all relevant standardAssignments over a subscription level scope.
SELECT
id,
name,
additionalData,
assignedComponent,
assignedStandard,
description,
displayName,
effect,
etag,
expiresOn,
kind,
location,
metadata,
scope,
systemData,
tags,
type
FROM azure.security.assignments
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: assignments
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the assignments resource.
- name: assignment_id
value: "{{ assignment_id }}"
description: Required parameter for the assignments resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the assignments resource.
- name: properties
description: |
Properties of a security assignment.
value:
displayName: "{{ displayName }}"
description: "{{ description }}"
assignedStandard:
id: "{{ id }}"
assignedComponent:
key: "{{ key }}"
scope: "{{ scope }}"
effect: "{{ effect }}"
expiresOn: "{{ expiresOn }}"
additionalData:
exemptionCategory: "{{ exemptionCategory }}"
metadata: "{{ metadata }}"
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives.
- name: kind
value: "{{ kind }}"
description: |
Kind of the resource.
- name: etag
value: "{{ etag }}"
description: |
Entity tag is used for comparing two or more entities from the same requested resource.
REPLACE examples
- create_or_update
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
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
;