Skip to main content

governance_assignments

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

Overview

Namegovernance_assignments
TypeResource
Idazure.security.governance_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.
additionalDataobjectThe additional data for the governance assignment - e.g. links to ticket (optional), see example.
governanceEmailNotificationobjectThe email notifications settings for the governance rule, states whether to disable notifications for mangers and owners.
isGracePeriodbooleanDefines whether there is a grace period on the governance assignment.
ownerstringThe Owner for the governance assignment - e.g. user@contoso.com _ - see example.
remediationDueDatestring (date-time)The remediation due-date - after this date Secure Score will be affected (in case of active grace-period). Required.
remediationEtaobjectThe ETA (estimated time of arrival) for remediation (optional), see example.
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
getselectscope, assessment_name, assignment_keyGet a specific governanceAssignment for the requested scope by AssignmentKey.
listselectscope, assessment_nameGet governance assignments on all of your resources inside a scope.
create_or_updateinsertscope, assessment_name, assignment_keyCreates or updates a governance assignment on the given subscription.
create_or_updatereplacescope, assessment_name, assignment_keyCreates or updates a governance assignment on the given subscription.
deletedeletescope, assessment_name, assignment_keyDelete a GovernanceAssignment 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
assessment_namestringThe assessment key of the governance assignment. Required.
assignment_keystringThe governance assignment key. Required.
scopestringThe scope of the governance assignment. Required.

SELECT examples

Get a specific governanceAssignment for the requested scope by AssignmentKey.

SELECT
id,
name,
additionalData,
governanceEmailNotification,
isGracePeriod,
owner,
remediationDueDate,
remediationEta,
systemData,
type
FROM azure.security.governance_assignments
WHERE scope = '{{ scope }}' -- required
AND assessment_name = '{{ assessment_name }}' -- required
AND assignment_key = '{{ assignment_key }}' -- required
;

INSERT examples

Creates or updates a governance assignment on the given subscription.

INSERT INTO azure.security.governance_assignments (
properties,
scope,
assessment_name,
assignment_key
)
SELECT
'{{ properties }}',
'{{ scope }}',
'{{ assessment_name }}',
'{{ assignment_key }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a governance assignment on the given subscription.

REPLACE azure.security.governance_assignments
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND assessment_name = '{{ assessment_name }}' --required
AND assignment_key = '{{ assignment_key }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a GovernanceAssignment over a given scope.

DELETE FROM azure.security.governance_assignments
WHERE scope = '{{ scope }}' --required
AND assessment_name = '{{ assessment_name }}' --required
AND assignment_key = '{{ assignment_key }}' --required
;