Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/quantum/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.0.0b15
+++++++++++++++
* Fixed bug where workspace providers were appended to wrong property causing workspace creation to fail
* Improved error handling for `az quantum workspace set` to provide a clear error message when a workspace is not yet fully provisioned

1.0.0b14
+++++++++++++++
* Updated control plane related commands to use latest API version 2025-12-15-preview
Expand Down
23 changes: 13 additions & 10 deletions src/quantum/azext_quantum/operations/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _autoadd_providers(cmd, providers_in_region, providers_selected, workspace_l
providers_selected.append(provider_selected)


def _add_quantum_providers(cmd, workspace, providers, auto_accept, skip_autoadd):
def _add_quantum_providers(cmd, workspace: QuantumWorkspace, providers, auto_accept, skip_autoadd):
providers_in_region_paged = cf_offerings(cmd.cli_ctx).list(location_name=workspace.location)
providers_in_region = [item for item in providers_in_region_paged]
providers_selected = []
Expand Down Expand Up @@ -183,7 +183,7 @@ def _add_quantum_providers(cmd, workspace, providers, auto_accept, skip_autoadd)
p = Provider()
p.provider_id = provider['provider_id']
p.provider_sku = provider['sku']
workspace.providers.append(p)
workspace.properties.providers.append(p)


def _validate_storage_account(tier_or_kind_msg_text, tier_or_kind, supported_tiers_or_kinds):
Expand All @@ -209,15 +209,12 @@ def create(cmd, resource_group_name, workspace_name, location, storage_account,
info = WorkspaceInfo(cmd, resource_group_name, workspace_name)
if not info.resource_group:
raise ResourceNotFoundError("Please run 'az quantum workspace set' first to select a default resource group.")
quantum_workspace = _get_basic_quantum_workspace(location, info, storage_account)
quantum_workspace: QuantumWorkspace = _get_basic_quantum_workspace(location, info, storage_account)

# Until the "--skip-role-assignment" parameter is deprecated, use the old non-ARM code to create a workspace without doing a role assignment
if skip_role_assignment:
_add_quantum_providers(cmd, quantum_workspace, provider_sku_list, auto_accept, skip_autoadd)
properties = WorkspaceResourceProperties()
properties.providers = quantum_workspace.providers
properties.api_key_enabled = True
quantum_workspace.properties = properties
quantum_workspace.properties.api_key_enabled = True
poller = client.begin_create_or_update(info.resource_group, info.name, quantum_workspace, polling=False)
while not poller.done():
time.sleep(POLLING_TIME_DURATION)
Expand All @@ -232,7 +229,7 @@ def create(cmd, resource_group_name, workspace_name, location, storage_account,

_add_quantum_providers(cmd, quantum_workspace, provider_sku_list, auto_accept, skip_autoadd)
validated_providers = []
for provider in quantum_workspace.providers:
for provider in quantum_workspace.properties.providers:
validated_providers.append({"providerId": provider.provider_id, "providerSku": provider.provider_sku})

# Set default storage account parameters in case the storage account does not exist yet
Expand Down Expand Up @@ -365,8 +362,14 @@ def set(cmd, workspace_name, resource_group_name, location=None):
client = cf_workspaces(cmd.cli_ctx)
info = WorkspaceInfo(cmd, resource_group_name, workspace_name)
ws = client.get(info.resource_group, info.name)
if ws:
info.save(cmd, ws.properties.endpoint_uri)
if not ws or not ws.properties.endpoint_uri:
provisioning_state = ws.properties.provisioning_state if ws and ws.properties else 'unknown'
raise InvalidArgumentValueError(
f"Workspace '{workspace_name}' is not ready (current state: '{provisioning_state}'). "
"Only workspaces in 'Succeeded' state can be set as default. "
"Please wait for the workspace to finish provisioning and try again."
)
info.save(cmd, ws.properties.endpoint_uri)
return ws


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def test_workspace_create_destroy(self):
self.check("properties.provisioningState", "Accepted") # Status is accepted since we're not linking the storage account.
])

time.sleep(10) # Wait for the workspace to be provisioned

# set
self.cmd(f'az quantum workspace set -g {test_resource_group} -w {test_workspace_temp} -l {test_location} -o json', checks=[
self.check("name", test_workspace_temp)
])

time.sleep(10) # Wait for the workspace to be created before fetching quotas

# list quotas
results = self.cmd('az quantum workspace quotas -o json').get_output_in_json()
assert len(results) > 0
Expand Down
2 changes: 1 addition & 1 deletion src/quantum/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# This version should match the latest entry in HISTORY.rst
# Also, when updating this, please review the version used by the extension to
# submit requests, which can be found at './azext_quantum/__init__.py'
VERSION = '1.0.0b14'
VERSION = '1.0.0b15'

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