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
idstring (arm-id)Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
namestringThe name of the resource
propertiesobjectThe properties of a governance assignment
systemDataobjectMetadata pertaining to creation and last modification of the resource.
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, assessmentName, assignmentKeyapi-versionGet a specific governanceAssignment for the requested scope by AssignmentKey
listselectscope, assessmentNameapi-versionGet governance assignments on all of your resources inside a scope
create_or_updateinsertscope, assessmentName, assignmentKeyapi-versionCreates or updates a governance assignment on the given subscription.
deletedeletescope, assessmentName, assignmentKeyapi-versionDelete 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
assessmentNamestringThe Assessment Key - Unique key for the assessment type
assignmentKeystringThe governance assignment key - the assessment key of the required governance assignment
scopestringThe scope of the standard assignment. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'
api-versionstringAPI version for the operation

SELECT examples

Get a specific governanceAssignment for the requested scope by AssignmentKey

SELECT
id,
name,
properties,
systemData,
type
FROM azure.security.governance_assignments
WHERE scope = '{{ scope }}' -- required
AND assessmentName = '{{ assessmentName }}' -- required
AND assignmentKey = '{{ assignmentKey }}' -- required
AND api-version = '{{ api-version }}'
;

INSERT examples

Creates or updates a governance assignment on the given subscription.

INSERT INTO azure.security.governance_assignments (
data__properties,
scope,
assessmentName,
assignmentKey,
api-version
)
SELECT
'{{ properties }}',
'{{ scope }}',
'{{ assessmentName }}',
'{{ assignmentKey }}',
'{{ api-version }}'
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 assessmentName = '{{ assessmentName }}' --required
AND assignmentKey = '{{ assignmentKey }}' --required
AND api-version = '{{ api-version }}'
;