Skip to content

Quantum: Update user create/delete operation - #10226

Draft
Konstantin Averkiev (kaverkiev) wants to merge 26 commits into
Azure:mainfrom
kaverkiev:v-kaverkiev/53910-Update-user-create-delete
Draft

Quantum: Update user create/delete operation#10226
Konstantin Averkiev (kaverkiev) wants to merge 26 commits into
Azure:mainfrom
kaverkiev:v-kaverkiev/53910-Update-user-create-delete

Conversation

@kaverkiev

@kaverkiev Konstantin Averkiev (kaverkiev) commented Aug 17, 2026

Copy link
Copy Markdown

🤖 PR Validation — ❌ Action needed

Breaking Changes
❌ 1
❌Azure CLI Extensions Breaking Change Test
❌quantum
rule cmd_name rule_message suggest_message
1007 - ParaRemove quantum workspace user create cmd quantum workspace user create removed parameter assignee_object_id please add back parameter assignee_object_id for cmd quantum workspace user create
1007 - ParaRemove quantum workspace user create cmd quantum workspace user create removed parameter assignee_principal_type please add back parameter assignee_principal_type for cmd quantum workspace user create
1007 - ParaRemove quantum workspace user create cmd quantum workspace user create removed parameter role please add back parameter role for cmd quantum workspace user create
1007 - ParaRemove quantum workspace user delete cmd quantum workspace user delete removed parameter assignee_object_id please add back parameter assignee_object_id for cmd quantum workspace user delete
1007 - ParaRemove quantum workspace user delete cmd quantum workspace user delete removed parameter role please add back parameter role for cmd quantum workspace user delete
⚠️ 1001 - CmdAdd quantum workspace user list cmd quantum workspace user list added
  • Forces assignee_principal_type="User" when creating the role assignment, so only user principals can be granted access.
  • Removed --assignee-principal-type entirely

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

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Konstantin Averkiev (@kaverkiev),
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kaverkiev
Konstantin Averkiev (kaverkiev) marked this pull request as ready for review August 18, 2026 19:49
Copilot AI lite review requested due to automatic review settings August 18, 2026 19:49
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 list with table output transformation and help/examples.
  • Updated workspace user create/delete to target user principals (including forcing assignee_principal_type="User" in the create path) and refreshed parameter/help text.
  • Bumped extension version to 1.0.0b21 and 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.

Comment thread src/quantum/azext_quantum/_params.py Outdated
Comment thread src/quantum/azext_quantum/operations/workspace.py Outdated
Comment thread src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py
@kaverkiev
Konstantin Averkiev (kaverkiev) marked this pull request as draft August 18, 2026 20:07
Konstantin added 2 commits August 18, 2026 13:08
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Comment thread src/quantum/azext_quantum/operations/workspace.py Outdated
Comment thread src/quantum/azext_quantum/operations/workspace.py Outdated
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@kaverkiev
Konstantin Averkiev (kaverkiev) marked this pull request as ready for review August 20, 2026 19:16
@azure-pipelines

Copy link
Copy Markdown
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.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you have separate PR for list users, can you delete it from this PR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@kaverkiev
Konstantin Averkiev (kaverkiev) marked this pull request as draft August 20, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants