Skip to content

Quantum: Make storage account optional for workspace creation - #10478

Draft
v-elegacheva wants to merge 5 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-remove-storage-option
Draft

v-elegacheva wants to merge 5 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-remove-storage-option

Conversation

@v-elegacheva

@v-elegacheva v-elegacheva commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️quantum
rule cmd_name rule_message suggest_message
⚠️ 1009 - ParaPropRemove quantum workspace create cmd quantum workspace create update parameter storage_account: removed property required=True

Summary

Make --storage-account optional for az quantum workspace create.

Changed

  • Use Azure Quantum managed storage when no storage account is provided.
  • Wait for managed-storage workspace provisioning to complete and surface provisioning failures.
  • Preserve the existing asynchronous behavior for explicit storage with --skip-role-assignment.
  • Update command help, examples, release history, and extension version.
  • Add V1 and V2 managed-storage test coverage, including V2 quota allocation.

Testing

  • Focused workspace suite:
  • 80 passed
  • 7 skipped
  • 18 subtests passed
  • Managed-storage V1 and V2 scenarios passed in the broader live run.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 16:35
@v-elegacheva
v-elegacheva marked this pull request as draft October 16, 2026 16:35
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 16, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution v-elegacheva! We will review the pull request and get back to you soon.

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.

🟢 Approval recommended

Static review found no blocking issues in the focused creation-path changes and accompanying coverage; tests were not run.

0 open findings

What changed in this PR

Makes storage optional when creating Azure Quantum workspaces, allowing Azure Quantum to provision managed storage.

Changes:

  • Adds managed-storage creation while preserving explicit storage support.
  • Updates help examples and adds unit and live-scenario coverage.
  • Bumps the extension to 1.0.0b31.
File Description
src/​quantum/​setup.py Bumps the extension version.
src/​quantum/​HISTORY.rst Documents optional storage.
src/​quantum/​azext_quantum/​tests/​latest/​test_quantum_workspace.py Adds managed-storage tests and updates polling assertions.
src/​quantum/​azext_quantum/​operations/​workspace.py Allows omitted storage and waits for managed-storage creation.
src/​quantum/​azext_quantum/​_params.py Explains the managed-storage default.
src/​quantum/​azext_quantum/​_help.py Updates workspace creation examples.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@v-elegacheva v-elegacheva changed the title Ekat/quantum remove storage option Quantum: Make storage account optional upon workspace creation Oct 16, 2026
@v-elegacheva v-elegacheva changed the title Quantum: Make storage account optional upon workspace creation Quantum: Make storage account optional for workspace creation Oct 16, 2026
return quantum_workspace
if not storage_account:
poller = client.begin_create_or_update(
info.resource_group, info.name, quantum_workspace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when storage name is specified - we set polling=False, but otherwise not, can we use same pattern for both?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it! Updated for both

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

still not addressed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I combined the calls but left polling= not storage_account. I changed that to polling = False for both direct api creation cases

# 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:
# Use direct API creation when storage is service-managed or role assignment is explicitly skipped.
if skip_role_assignment or not storage_account:
_add_quantum_providers(cmd, quantum_workspace, provider_sku_list, auto_accept, skip_autoadd)
_apply_target_quotas(quantum_workspace.properties.providers, quota)

@rigidit Zulfat Nutfullin (rigidit) Oct 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

while we are here can we improve this to call v2 related methods only for v2 workspace, like:
if workspace_kind_value == WorkspaceKind.V2.value:
_apply_target_quotas(quantum_workspace.properties.providers, quota)
_validate_target_quota_bounds(cmd, info, quantum_workspace, quota, include_usage=False)
quantum_workspace.properties.workspace_kind = WorkspaceKind.V2
quantum_workspace.properties.api_key_enabled = False
and we probably don't need else here as we probably can skip setting api_key_enabled (check in backend)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and I think we have some of the code duplicate later, so we could just call it once

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it! Also for removing of the else statement: looks like omitting apiKeyEnabled on a create-or-update request disables api keys for an existing v1 workspace (but it defaults to true for a new one). So I kept the = True assignment to preserve existing behavior

f'az quantum workspace create --auto-accept --skip-autoadd '
f'-g {test_resource_group} -w {test_workspace} '
f'-l {test_location} -r "{test_provider_sku_list}" -o json',
checks=[self.check('properties.provisioningState', 'Succeeded')]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it can take some time to be fully provisioned, can you use same waiting pattern that we have in other tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all updated!

('workspace defaults', 'az quantum workspace clear')
)
run_cleanup_commands(self, cleanup_commands)

def test_workspace_v2_create_destroy(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you create additional test to test v2 workspace creation without specifiying storage account instead modifiying test that we need to test with user specified storage account

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please make sure we cover e2e the following scenarios:

  1. v1 workspace creation with user provided storage account
  2. v1 workspace creation without provided storage so we will create managed storage account
  3. v2 workspace creation with user provided storage account
  4. v2 workspace creation without provided storage so we will create managed storage account ouselves

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it! All 4 scenarios passed in local live (had to increasing the provisioning-wait budget a little bit because the case with V1 supplied-storage took a little longer)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename tests accordingly: *_with_managed_storage, *_with_user_storage

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tests have been renamed to contain with_managed_storage or with_user_storage

Comment thread src/quantum/azext_quantum/_help.py Outdated
- name: Create a new Azure Quantum workspace with a specific storage account.
text: |-
az quantum workspace create -g MyResourceGroup -w MyWorkspace -l MyLocation \\
--storage-account MyStorageAccountName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use short version for storage account parameter as you are using for other params here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it!

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

])

time.sleep(10) # Wait for the workspace to be provisioned
_wait_for_workspace_provisioned(self, test_resource_group, test_workspace_temp, attempts=MANAGED_STORAGE_PROVISIONING_ATTEMPTS) # Wait for the workspace to be provisioned

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

MANAGED_STORAGE_PROVISIONING_ATTEMPTS is now also used for the --skip-role-assignment case, which uses your own storage. A more general name would fit better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, renamed it WORKSPACE_PROVISIONING_ATTEMPTS

self.cmd(f'az quantum workspace create --auto-accept -g {test_resource_group} -w {test_workspace_temp} -l {test_location} -a {test_storage_account} -r {test_provider_sku_list} -o json --skip-role-assignment', checks=[
self.check("name", test_workspace_temp),
self.check("properties.provisioningState", "Accepted") # Status is accepted since we're not linking the storage account.
self.check("properties.provisioningState", "Accepted") # Accepted because --skip-role-assignment returns without waiting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

update test name to reflect that it tests v1 creation with user specified storage

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Scenario 1 (V1 with your own storage account) checks too little. The existing test only confirms the deployment name. It doesn't check that the workspace is linked to that storage account. The V2 test does check this, so the same assertion could be copied over.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test has been renamed. And I added _assert_user_storage() after provisioning in each v1 user-storage subcase. It verifies that the workspace is linked to the expected storage account and that managed stage is absent. V2 uses same helper

self.assertTrue(properties.get('managedStorageAccount'))
self.assertFalse(properties.get('storageAccount'))

def test_workspace_v1_create_destroy_without_storage_account(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

better name: test_workspace_v1_create_destroy_with_managed_storage
for cases when user specified storage: test_workspace_v1_create_destroy_with_user_storage

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated both names

)

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
MANAGED_STORAGE_PROVISIONING_ATTEMPTS = 60

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this is 60?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The v1 case with provided storage needed 31 checks (~6.5 minutes) before the provisioning succeeded. I increased the checks to 60 to allow headroom for slower runs. This allows roughly 11 minutes of waiting + command execution time

quantum_workspace = poller.result()
return quantum_workspace

if skip_role_assignment or not storage_account:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--skip-role-assignment is ignored without -a. It's silently ignored, and its help text hasn't changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added validation to reject --skip-role-assignment when -a is omitted, since roles are managed automatically by azure quantum when no storage is provided by user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-codegen-extensibility-squad Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Quantum az quantum

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants