Skip to content

[Identity] az identity create/update: Add new --resource-restriction parameter to support identity assignment restrictions#32214

Open
mohamedyilmaz123 wants to merge 49 commits into
Azure:devfrom
mohamedyilmaz123:ibrahimmo/addAssignmentRestrictions
Open

[Identity] az identity create/update: Add new --resource-restriction parameter to support identity assignment restrictions#32214
mohamedyilmaz123 wants to merge 49 commits into
Azure:devfrom
mohamedyilmaz123:ibrahimmo/addAssignmentRestrictions

Conversation

@mohamedyilmaz123
Copy link
Copy Markdown

@mohamedyilmaz123 mohamedyilmaz123 commented Oct 2, 2025

Related command

Includes the resource restriction property.
az identity create
az identity update

No changes with respect to the resource-restriction property.
az identity show
az identity delete
az identity list

I have changed the identity commands to use the AAZ implementation by: -

  1. Removing custom SDK implementation for the above 5 commands
  2. Retaining AAZ command loading logic in init.py

This enables identity commands support through the AAZ implementation using API version 2025-05-31-preview

Description

Make updates to the identity module to invoke AAZ generated operations (create, update, list, show) for UserAssigned identities with 2025-05-31-Preview version
Enables support for identity resource restrictions property on create, update
Adds support for identity update, including changes to the resource restrictions property

Testing Guide

We need to test all the commands under identity subgroup to make sure az identity (create, update) commands now support creation with the resource restriction property and no regression is observed in az identity (delete, list, show) commands.

Test Commands
1] az identity create -g $RG -n $NAME --subscription $SUB --resource-restriction "providers=[Microsoft.Compute]"
2] az identity update -g $RG -n $NAME --subscription $SUB
--resource-restriction "providers=[Microsoft.Storage]"
3] az identity show -g $RG -n $NAME --subscription $SUB
4] az identity list -g $RG --subscription $SUB
5] az identity delete -g $RG -n $NAME --subscription $SUB

History Notes

[Identity] az identity create: Add new --resource-restriction parameter to support identity assignment restrictions
[Identity] az identity update: Add new command to support updating an identity


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Oct 2, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Oct 2, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️identity
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd identity create cmd identity create added parameter assignment_restrictions
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter isolation_scope: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter isolation_scope: added property type=string
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter location: added property aaz_type=string
⚠️ 1010 - ParaPropUpdate identity create cmd identity create update parameter location: updated property type from custom_type to string
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity create cmd identity create update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter resource_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter resource_name: added property type=string
⚠️ 1009 - ParaPropRemove identity create cmd identity create update parameter resource_name: removed property id_part=name
⚠️ 1010 - ParaPropUpdate identity create cmd identity create update parameter resource_name: updated property options from ['--name', '-n'] to ['--name', '--resource-name', '-n']
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter tags: added property aaz_type=AAZDictArg
⚠️ 1008 - ParaPropAdd identity create cmd identity create update parameter tags: added property type=Dict<String,String>
⚠️ 1010 - ParaPropUpdate identity create cmd identity create update parameter tags: updated property nargs from * to +
⚠️ 1008 - ParaPropAdd identity delete cmd identity delete update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity delete cmd identity delete update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity delete cmd identity delete update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd identity delete cmd identity delete update parameter resource_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity delete cmd identity delete update parameter resource_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity delete cmd identity delete update parameter resource_name: updated property options from ['--name', '-n'] to ['--name', '--resource-name', '-n']
⚠️ 1006 - ParaAdd identity list cmd identity list added parameter pagination_limit
⚠️ 1006 - ParaAdd identity list cmd identity list added parameter pagination_token
⚠️ 1008 - ParaPropAdd identity list cmd identity list update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity list cmd identity list update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity list cmd identity list update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd identity show cmd identity show update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity show cmd identity show update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity show cmd identity show update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd identity show cmd identity show update parameter resource_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity show cmd identity show update parameter resource_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity show cmd identity show update parameter resource_name: updated property options from ['--name', '-n'] to ['--name', '--resource-name', '-n']
⚠️ 1006 - ParaAdd identity update cmd identity update added parameter assignment_restrictions
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter isolation_scope: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter isolation_scope: added property type=string
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter properties_to_add: added property aaz_type=AAZGenericUpdateAddArg
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter properties_to_remove: added property aaz_type=AAZGenericUpdateRemoveArg
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter properties_to_set: added property aaz_type=AAZGenericUpdateSetArg
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity update cmd identity update update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter resource_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter resource_name: added property type=string
⚠️ 1010 - ParaPropUpdate identity update cmd identity update update parameter resource_name: updated property options from ['--name', '-n'] to ['--name', '--resource-name', '-n']
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter tags: added property aaz_type=AAZDictArg
⚠️ 1008 - ParaPropAdd identity update cmd identity update update parameter tags: added property type=Dict<String,String>
⚠️ 1010 - ParaPropUpdate identity update cmd identity update update parameter tags: updated property nargs from * to +

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Oct 2, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 2, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@mohamedyilmaz123 mohamedyilmaz123 changed the title [Identity] az identity create/update: Add new --assignment-restrictions parameter to support identity assignment restrictions [Identity] az identity create/update: Add new --assignment-restriction parameter to support identity assignment restrictions Oct 21, 2025
@mohamedyilmaz123
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms Apr 23, 2026
Mohamed Yilmaz Ibrahim added 2 commits May 7, 2026 14:52
…entRestrictions

# Conflicts:
#	src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_linux_acr_use_identity.yaml
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 7, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Mohamed Yilmaz Ibrahim added 2 commits May 7, 2026 17:34
@isra-fel
Copy link
Copy Markdown
Member

isra-fel commented May 8, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with one question: since the implmentation of the az identity commands has been switched to aaz, shouldn't the old impl be removed? For example. or are they still in use somewhere?

@mohamedyilmaz123
Copy link
Copy Markdown
Author

Looks good with one question: since the implmentation of the az identity commands has been switched to aaz, shouldn't the old impl be removed? For example. or are they still in use somewhere?

Yes, the list resources action still uses the SDK implementation.

# Conflicts:
#	src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_identity.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-identity-squad Auto-Assign Auto assign by bot Managed Identity For `az identity` only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants