Skip to main content

standard_assignments

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

Overview

Namestandard_assignments
TypeResource
Idazure.security.standard_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.
assignedStandardobjectStandard item with key as applied to this standard assignment over the given scope.
attestationDataobjectAdditional data about assignment that has Attest effect.
descriptionstringDescription of the standardAssignment.
displayNamestringDisplay name of the standardAssignment.
effectstringExpected effect of this assignment (Audit/Exempt/Attest). Known values are: "Audit", "Exempt", and "Attest". (Audit, Exempt, Attest)
excludedScopesarrayExcluded scopes, filter out the descendants of the scope (on management scopes).
exemptionDataobjectAdditional data about assignment that has Exempt effect.
expiresOnstring (date-time)Expiration date of this assignment as a full ISO date.
metadataobjectThe standard assignment metadata.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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_id, standard_assignment_nameRetrieves a standard assignment. This operation retrieves a single standard assignment, given its name and the scope it was created at.
listselectscopeGet a list of all relevant standard assignments over a scope.
createinsertresource_id, standard_assignment_nameCreates or updates a standard assignment. This operation creates or updates a standard assignment with the given scope and name. standard assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.
deletedeleteresource_id, standard_assignment_nameDeletes a standard assignment. This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a standard assignment is the part of its ID preceding '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'.

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
resource_idstringThe fully qualified Azure Resource manager identifier of the resource. Required.
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.
standard_assignment_namestringThe standard assignments assignment key - unique key for the standard assignment. Required.

SELECT examples

Retrieves a standard assignment. This operation retrieves a single standard assignment, given its name and the scope it was created at.

SELECT
id,
name,
assignedStandard,
attestationData,
description,
displayName,
effect,
excludedScopes,
exemptionData,
expiresOn,
metadata,
systemData,
type
FROM azure.security.standard_assignments
WHERE resource_id = '{{ resource_id }}' -- required
AND standard_assignment_name = '{{ standard_assignment_name }}' -- required
;

INSERT examples

Creates or updates a standard assignment. This operation creates or updates a standard assignment with the given scope and name. standard assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

INSERT INTO azure.security.standard_assignments (
properties,
resource_id,
standard_assignment_name
)
SELECT
'{{ properties }}',
'{{ resource_id }}',
'{{ standard_assignment_name }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

Deletes a standard assignment. This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a standard assignment is the part of its ID preceding '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'.

DELETE FROM azure.security.standard_assignments
WHERE resource_id = '{{ resource_id }}' --required
AND standard_assignment_name = '{{ standard_assignment_name }}' --required
;