Quantum: Update user create/delete operation - #10226
Quantum: Update user create/delete operation#10226Konstantin Averkiev (kaverkiev) wants to merge 26 commits into
Conversation
…ser list` command
…help documentation
|
Hi Konstantin Averkiev (@kaverkiev), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR updates the quantum Azure CLI extension’s workspace user access commands by restricting role-assignment operations to user principals, introducing a new az quantum workspace user list command, and bumping the extension version/release notes accordingly.
Changes:
- Added
az quantum workspace user listwith table output transformation and help/examples. - Updated
workspace user create/deleteto target user principals (including forcingassignee_principal_type="User"in the create path) and refreshed parameter/help text. - Bumped extension version to
1.0.0b21and added corresponding HISTORY entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/quantum/setup.py | Bumps extension package version to 1.0.0b21. |
| src/quantum/HISTORY.rst | Documents the new user list command and updated create/delete behavior. |
| src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py | Adds coverage for the new list command and related helpers. |
| src/quantum/azext_quantum/operations/workspace.py | Forces assignee_principal_type="User" in create and adds list_users implementation. |
| src/quantum/azext_quantum/commands.py | Registers quantum workspace user list and adds transform_users. |
| src/quantum/azext_quantum/_params.py | Updates user-related parameter help and introduces --include-inherited. |
| src/quantum/azext_quantum/_help.py | Adds help for user list and updates create/delete summaries/examples. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…-Update-user-create-delete # Conflicts: # src/quantum/azext_quantum/_params.py
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
…kaverkiev/azure-cli-extensions into v-kaverkiev/workspace-user-list
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
…D; update related tests
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
| def list_users(cmd, resource_group_name=None, workspace_name=None, include_inherited=True): | ||
| """ | ||
| List the users with access to an Azure Quantum workspace. | ||
| """ |
There was a problem hiding this comment.
you have separate PR for list users, can you delete it from this PR?
There was a problem hiding this comment.
I merged that PR here because it contains some changes related to this also. It will gone when we merged first one
| assignee_object_id_type = CLIArgumentType(options_list=['--assignee-object-id'], help="Use this parameter instead of '--assignee' to bypass Graph API invocation in case of insufficient privileges. This parameter only works with object ids for users, groups, service principals, and managed identities. For managed identities use the principal id. For service principals, use the object id and not the app id.") | ||
| role_type = CLIArgumentType(options_list=['--role'], help="Role name or id. For 'create', the role granted to the user; for 'delete', the role assignment to remove. Defaults to the 'Quantum Workspace Data Contributor' role.") | ||
| assignee_principal_type_type = CLIArgumentType(options_list=['--assignee-principal-type'], arg_type=get_enum_type(['User', 'Group', 'ServicePrincipal', 'ForeignGroup']), help="Use with '--assignee-object-id' to avoid errors caused by propagation latency in Microsoft Graph.") | ||
| email_type = CLIArgumentType(options_list=['--email'], help='The user to grant or remove access. Provide the user sign-in name (email); an object id is also accepted.') |
There was a problem hiding this comment.
I think object id should not be accepted if the name of the param is email
| @@ -139,6 +151,7 @@ def load_command_table(self, _): | |||
| with self.command_group('quantum workspace user', workspace_ops) as u: | |||
| u.command('create', 'add_user', validator=validate_workspace_info) | |||
There was a problem hiding this comment.
can we also rename 'create' to 'add', and 'delete' to 'remove'? we are not creating or deleting user, we just adding/removing them from a workspace
🤖 PR Validation — ❌ Action needed
❌Azure CLI Extensions Breaking Change Test
--assignee-principal-typeentirelyThis checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.