Share via


az blueprint assignment

Note

This reference is part of the blueprint extension for the Azure CLI (version 2.50.0 or higher). The extension will automatically install the first time you run an az blueprint assignment command. Learn more about extensions.

Commands to manage blueprint assignment.

Commands

Name Description Type Status
az blueprint assignment create

Create a blueprint assignment.

Extension GA
az blueprint assignment delete

Delete a blueprint assignment.

Extension Preview
az blueprint assignment list

List blueprint assignments within a subscription.

Extension Preview
az blueprint assignment show

Get a blueprint assignment.

Extension Preview
az blueprint assignment update

Update a blueprint assignment.

Extension GA
az blueprint assignment wait

Place the CLI in a waiting state until a condition of the Blueprint Assignment is met.

Extension GA
az blueprint assignment who

Get Blueprint Servie Principal Name objectId.

Extension Preview

az blueprint assignment create

Create a blueprint assignment.

az blueprint assignment create --name
                               [--blueprint-version]
                               [--description]
                               [--display-name]
                               [--identity-type {None, SystemAssigned, UserAssigned}]
                               [--location]
                               [--locks-excluded-principals]
                               [--locks-mode {AllResourcesDoNotDelete, AllResourcesReadOnly, None}]
                               [--management-group]
                               [--parameters]
                               [--resource-group-value]
                               [--subscription]
                               [--user-assigned-identity]

Examples

Assignment with system-assigned managed identity

az blueprint assignment create --subscription MySubscription --name \
MyBlueprintAssignment --location eastus --identity-type SystemAssigned \
--description "Enforce pre-defined MyBlueprint to this subscription." \
--blueprint-version "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/provid \
ers/Microsoft.Blueprint/blueprints/MyBlueprint/versions/v2" \
--resource-group-value artifact_name=rg-art-1 name=rg1 location=westus \
--resource-group-value artifact_name=rg-art-2 name=rg2 location=eastus \
--parameters "path/to/parameter/file" \

Assignment with user-assigned managed identity

az blueprint assignment create --subscription MySubscription --name \
MyBlueprintAssignment --location eastus --identity-type UserAssigned \
--user-assigned-identity "/subscriptions/00000000-0000-0000-0000-000000000000 \
/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"\
--description "Enforce pre-defined MyBlueprint to this subscription." \
--blueprint-version "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup \
/providers/Microsoft.Blueprint/blueprints/MyBlueprint/versions/v2" \
--resource-group-value artifact_name=rg-art-1 name=rg1 location=eastus \
--parameters "path/to/parameter/file" \

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--blueprint-version

Resource ID of the published version of a blueprint definition.

--description

Multi-line explain this resource.

--display-name

One-liner string explain this resource.

--identity-type

Type of the managed identity.

Accepted values: None, SystemAssigned, UserAssigned
Default value: SystemAssigned
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--locks-excluded-principals

List of AAD principals excluded from blueprint locks. Up to 5 principals are permitted.

--locks-mode

Lock mode.

Accepted values: AllResourcesDoNotDelete, AllResourcesReadOnly, None
--management-group -m

Use management group for the target scope of the blueprint assignment. It is reserved for future use. Use --subscription instead.

--parameters -p

Blueprint assignment parameter values. It can be a JSON string or JSON file path.

--resource-group-value

Key=Value pairs for a resource group. Keys include 'artifact_name'(required), 'name', 'location'.

--subscription -s

Use subscription for the target scope of the blueprint assignment. Default susbcription will be used if option not specified.

--user-assigned-identity

The user-assigned managed identity associated with the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment delete

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a blueprint assignment.

az blueprint assignment delete --name
                               [--delete-behavior {all, none}]
                               [--management-group]
                               [--subscription]
                               [--yes]

Examples

Delete an assignment

az blueprint assignment delete --subscription MySubscription --name MyBlueprintAssignment

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--delete-behavior

When deleteBehavior=all, the resources that were created by the blueprint assignment will be deleted.

Accepted values: all, none
--management-group -m

Use management group for the scope of the blueprint.

--subscription -s

Use subscription for the scope of the blueprint. If --management-group is not specified, --subscription value or the default subscription will be used as the scope.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment list

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List blueprint assignments within a subscription.

az blueprint assignment list [--management-group]
                             [--max-items]
                             [--next-token]
                             [--subscription]

Examples

List assignments

az blueprint assignment list --subscription MySubscription

Optional Parameters

--management-group -m

Use management group for the scope of the blueprint.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

--subscription -s

Use subscription for the scope of the blueprint. If --management-group is not specified, --subscription value or the default subscription will be used as the scope.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment show

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get a blueprint assignment.

az blueprint assignment show --name
                             [--management-group]
                             [--subscription]

Examples

Show an assignment

az blueprint assignment show --subscription MySubscription --name MyBlueprintAssignment

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--management-group -m

Use management group for the scope of the blueprint.

--subscription -s

Use subscription for the scope of the blueprint. If --management-group is not specified, --subscription value or the default subscription will be used as the scope.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment update

Update a blueprint assignment.

az blueprint assignment update --name
                               [--blueprint-version]
                               [--description]
                               [--display-name]
                               [--identity-type {None, SystemAssigned, UserAssigned}]
                               [--location]
                               [--locks-excluded-principals]
                               [--locks-mode {AllResourcesDoNotDelete, AllResourcesReadOnly, None}]
                               [--management-group]
                               [--parameters]
                               [--resource-group-value]
                               [--subscription]
                               [--user-assigned-identity]

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--blueprint-version

Resource ID of the published version of a blueprint definition.

--description

Multi-line explain this resource.

--display-name

One-liner string explain this resource.

--identity-type

Type of the managed identity.

Accepted values: None, SystemAssigned, UserAssigned
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--locks-excluded-principals

List of AAD principals excluded from blueprint locks. Up to 5 principals are permitted.

--locks-mode

Lock mode.

Accepted values: AllResourcesDoNotDelete, AllResourcesReadOnly, None
--management-group -m

Use management group for the target scope of the blueprint assignment. It is reserved for future use. Use --subscription instead.

--parameters -p

Blueprint assignment parameter values. It can be a JSON string or JSON file path.

--resource-group-value

Key=Value pairs for a resource group. Keys include 'artifact_name'(required), 'name', 'location'.

--subscription -s

Use subscription for the target scope of the blueprint assignment. Default susbcription will be used if option not specified.

--user-assigned-identity

The user-assigned managed identity associated with the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment wait

Place the CLI in a waiting state until a condition of the Blueprint Assignment is met.

az blueprint assignment wait --name
                             [--created]
                             [--custom]
                             [--deleted]
                             [--exists]
                             [--interval]
                             [--management-group]
                             [--subscription]
                             [--timeout]
                             [--updated]

Examples

Pause executing next line of CLI script until the Blueprint Assignment is successfully provisioned.

az blueprint assignment wait --subscription MySubscription \ --name MyBlueprintAssignment --created

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--interval

Polling interval in seconds.

Default value: 30
--management-group -m

Use management group for the target scope of the blueprint assignment. It is reserved for future use. Use --subscription instead.

--subscription -s

Use subscription for the target scope of the blueprint assignment. Default susbcription will be used if option not specified.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az blueprint assignment who

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get Blueprint Servie Principal Name objectId.

az blueprint assignment who --name
                            [--management-group]
                            [--subscription]

Examples

Get SPN objectId

az blueprint assignment who --subscription MySubscription --name MyBlueprintAssignment

Required Parameters

--name -n

Name of the blueprint assignment.

Optional Parameters

--management-group -m

Use management group for the scope of the blueprint.

--subscription -s

Use subscription for the scope of the blueprint. If --management-group is not specified, --subscription value or the default subscription will be used as the scope.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.