Quantum: V2 workspace support#9939
Draft
s-ddavydenko wants to merge 5 commits into
Draft
Conversation
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| quantum workspace create | cmd quantum workspace create added parameter workspace_kind |
Collaborator
|
Quantum |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for creating Azure Quantum V2 workspaces via a new --workspace-kind argument on az quantum workspace create.
Changes:
- Adds
--workspace-kindCLI parameter and wires it through workspace creation code paths. - Updates the ARM template to pass
workspaceKindwhen provided. - Bumps extension version and updates release notes; adds tests covering workspace kind serialization.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/quantum/setup.py | Bumps package version to 1.0.0b17. |
| src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py | Adds tests for workspace_kind model serialization behavior. |
| src/quantum/azext_quantum/operations/workspace.py | Plumbs workspace_kind into workspace creation (SDK + ARM template parameters). |
| src/quantum/azext_quantum/operations/templates/create-workspace-and-assign-role.json | Adds workspaceKind parameter and injects it into the workspace resource properties. |
| src/quantum/azext_quantum/_params.py | Introduces --workspace-kind argument. |
| src/quantum/azext_quantum/_help.py | Documents example usage for creating a V2 workspace. |
| src/quantum/HISTORY.rst | Adds 1.0.0b17 changelog entry. |
| "type": "string", | ||
| "defaultValue": "", | ||
| "metadata": { | ||
| "description": "The kind of workspace to create: V1 or V2. Empty string means the service default (V1)." |
| "providers": "[parameters('providers')]", | ||
| "storageAccount": "[parameters('storageAccountId')]" | ||
| "storageAccount": "[parameters('storageAccountId')]", | ||
| "workspaceKind": "[if(empty(parameters('workspaceKind')), json('null'), parameters('workspaceKind'))]" |
| assert providers_selected[0] == {"provider_id": "foo", "sku": "foo_credits_for_all_plan", "offer_id": "foo_offer", "publisher_id": "foo0123456789"} | ||
|
|
||
| def test_workspace_kind(self): | ||
| print("test_workspace_kind") |
Comment on lines
+327
to
+331
| # V1 workspace: workspace_kind is None by default (field omitted from request, service defaults to V1) | ||
| props = WorkspaceResourceProperties() | ||
| assert props.workspace_kind is None | ||
| serialized = props.serialize() | ||
| assert serialized.get("workspaceKind") is None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--workspace-kindparameter toaz quantum workspace create, allowing users to specify whether to create a V1 or V2 Azure Quantum workspace.Motivation
V2 workspaces have a different architecture and must be explicitly requested at creation time. The service already supports this via the
workspaceKindfield in the REST API, but there was no way to set it from the CLI — users had to use the portal or call the API directly.Changes
workspace_kindthrough both code paths: the direct API path (--skip-role-assignment), and the ARM template path includes it as aworkspaceKindparameter.workspaceKindto the workspace resource properties, setting it to an empty string for a V1 workspace (legacy behavior) orV2for a V2 workspaceTesting
workspaceKindas null, setting it to V1 and setting it to V2 against a personal Azure subscription