Skip to main content

assignments

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

Overview

Nameassignments
TypeResource
Idazure.blueprints.assignments

Fields

The following fields are returned by SELECT queries:

OK -- blueprint assignment retrieved.

NameDatatypeDescription
identityobjectManaged identity for this blueprint assignment.
locationstringThe geo-location where the resource lives
propertiesobjectProperties for blueprint assignment object.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceScope, assignmentNameGet a blueprint assignment.
listselectresourceScopeList blueprint assignments within a subscription or a management group.
create_or_updateinsertresourceScope, assignmentName, data__identity, data__propertiesCreate or update a blueprint assignment.
deletedeleteresourceScope, assignmentNamedeleteBehaviorDelete a blueprint assignment.
who_is_blueprintexecresourceScope, assignmentNameGet Blueprints service SPN objectId

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
assignmentNamestringName of the blueprint assignment.
resourceScopestringThe scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').
deleteBehaviorstringWhen deleteBehavior=all, the resources that were created by the blueprint assignment will be deleted.

SELECT examples

Get a blueprint assignment.

SELECT
identity,
location,
properties,
tags
FROM azure.blueprints.assignments
WHERE resourceScope = '{{ resourceScope }}' -- required
AND assignmentName = '{{ assignmentName }}' -- required
;

INSERT examples

Create or update a blueprint assignment.

INSERT INTO azure.blueprints.assignments (
data__identity,
data__properties,
data__tags,
data__location,
resourceScope,
assignmentName
)
SELECT
'{{ identity }}' /* required */,
'{{ properties }}' /* required */,
'{{ tags }}',
'{{ location }}',
'{{ resourceScope }}',
'{{ assignmentName }}'
RETURNING
identity,
location,
properties,
tags
;

DELETE examples

Delete a blueprint assignment.

DELETE FROM azure.blueprints.assignments
WHERE resourceScope = '{{ resourceScope }}' --required
AND assignmentName = '{{ assignmentName }}' --required
AND deleteBehavior = '{{ deleteBehavior }}'
;

Lifecycle Methods

Get Blueprints service SPN objectId

EXEC azure.blueprints.assignments.who_is_blueprint 
@resourceScope='{{ resourceScope }}' --required,
@assignmentName='{{ assignmentName }}' --required
;