Skip to content

Commit 4d151e7

Browse files
committed
Worspace set command improvements
1 parent e2640e5 commit 4d151e7

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/quantum/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
1.0.0b15
7+
+++++++++++++++
8+
* Fixed bug where workspace providers were appended to wrong property causing workspace creation to fail
9+
* Improved error handling for `az quantum workspace set` to provide a clear error message when a workspace is not yet fully provisioned
10+
611
1.0.0b14
712
+++++++++++++++
813
* Updated control plane related commands to use latest API version 2025-12-15-preview

src/quantum/azext_quantum/operations/workspace.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,14 @@ def set(cmd, workspace_name, resource_group_name, location=None):
362362
client = cf_workspaces(cmd.cli_ctx)
363363
info = WorkspaceInfo(cmd, resource_group_name, workspace_name)
364364
ws = client.get(info.resource_group, info.name)
365-
if ws:
366-
info.save(cmd, ws.properties.endpoint_uri)
365+
if not ws or not ws.properties.endpoint_uri:
366+
provisioning_state = ws.properties.provisioning_state if ws and ws.properties else 'unknown'
367+
raise InvalidArgumentValueError(
368+
f"Workspace '{workspace_name}' is not ready (current state: '{provisioning_state}'). "
369+
"Only workspaces in 'Succeeded' state can be set as default. "
370+
"Please wait for the workspace to finish provisioning and try again."
371+
)
372+
info.save(cmd, ws.properties.endpoint_uri)
367373
return ws
368374

369375

src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ def test_workspace_create_destroy(self):
107107
self.check("properties.provisioningState", "Accepted") # Status is accepted since we're not linking the storage account.
108108
])
109109

110+
time.sleep(10) # Wait for the workspace to be provisioned
111+
110112
# set
111113
self.cmd(f'az quantum workspace set -g {test_resource_group} -w {test_workspace_temp} -l {test_location} -o json', checks=[
112114
self.check("name", test_workspace_temp)
113115
])
114116

115-
time.sleep(10) # Wait for the workspace to be created before fetching quotas
116-
117117
# list quotas
118118
results = self.cmd('az quantum workspace quotas -o json').get_output_in_json()
119119
assert len(results) > 0

src/quantum/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# This version should match the latest entry in HISTORY.rst
1818
# Also, when updating this, please review the version used by the extension to
1919
# submit requests, which can be found at './azext_quantum/__init__.py'
20-
VERSION = '1.0.0b14'
20+
VERSION = '1.0.0b15'
2121

2222
# The full list of classifiers is available at
2323
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)