Skip to content

Quantum: Remove the unused job --storage option and legacy SDK storage support - #10541

Draft
v-elegacheva wants to merge 15 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-deprecate-storage-connection-string
Draft

v-elegacheva wants to merge 15 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-deprecate-storage-connection-string

Conversation

@v-elegacheva

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

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ❌ Action needed

Breaking Changes Suppressions
❌ 1 ️✔️ None
❌Azure CLI Extensions Breaking Change Test
❌quantum
rule cmd_name rule_message suggest_message
❌ 1007 - ParaRemove quantum execute cmd quantum execute removed parameter storage please add back parameter storage for cmd quantum execute
❌ 1007 - ParaRemove quantum job submit cmd quantum job submit removed parameter storage please add back parameter storage for cmd quantum job submit
❌ 1007 - ParaRemove quantum run cmd quantum run removed parameter storage please add back parameter storage for cmd quantum run

Summary

Remove the unused job-level --storage option and legacy storage connection-string support from the vendored Quantum SDK. Jobs continue to use workspace-linked storage.

Changes

  • Remove --storage from az quantum job submit, az quantum run, and az quantum execute.
  • Use the standard Azure CLI unrecognized-argument error when the removed option is supplied. Existing scripts should remove this argument.
  • Remove the vendored SDK's explicit storage override and obsolete connection-string-based container helpers, aligning with the upstream SDK change.
  • Document the breaking change and migration in the release notes.
  • Preserve workspace-authentication connection strings and the workspace-level --storage-account option.

Testing

  • Local offline suite: 159 passed, 17 skipped, 85 subtests passed.
  • Added one focused unit test verifying that submit() calls Workspace with resource_id and credential, without a storage argument. Existing job and workspace tests remain unchanged.
  • Additional local smoke checks—not committed regression tests—verified:
    • Standard rejection of --storage value and --storage=value across all three affected commands.
    • Job command help no longer exposes --storage; workspace creation still exposes --storage-account.
    • Workspace discovery, linked-storage SAS retrieval, and optional-argument forwarding.
  • Repository-configured Flake8 and Pylint checks passed.

@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 30, 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.

@x-engineering-agent
x-engineering-agent Bot requested a review from a team October 30, 2026 18:37
@v-elegacheva v-elegacheva changed the title [Quantum] Remove storage connection-string overrides Quantum: Remove the unused job --storage option and legacy SDK storage support Oct 30, 2026
Keep workspace creation changes owned by PR Azure#10478 and preserve the standalone job storage removal. Rename the shared command-parser test helper to reflect its workspace and job usage.

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

No active review issues are reported for the change removing per-job storage overrides in favor of workspace-linked storage.

No open issues 🎉

What changed in this PR

Removes the unused per-job --storage option and legacy storage overrides from the Quantum extension’s vendored SDK, keeping jobs on workspace-linked storage.

Changes:

  • Removes --storage from job commands and adds migration errors that do not echo its value.
  • Removes SDK storage connection-string overrides and obsolete container helpers.
  • Adds regression tests, updates migration documentation and help, and bumps the version to 1.0.0b32.
File Description
src/​quantum/​setup.py Bumps the extension version to 1.0.0b32.
src/​quantum/​README.rst Documents option removal and migration guidance.
src/​quantum/​HISTORY.rst Records the breaking change and SDK cleanup.
src/​quantum/​azext_quantum/​vendored_sdks/​azure_quantum_python/​workspace.py Removes storage overrides and uses linked storage exclusively.
src/​quantum/​azext_quantum/​vendored_sdks/​azure_quantum_python/​storage.py Removes obsolete connection-string container helpers.
src/​quantum/​azext_quantum/​tests/​latest/​test_quantum_workspace.py Tests SDK argument rejection and linked-storage behavior.
src/​quantum/​azext_quantum/​tests/​latest/​test_quantum_jobs.py Tests parsing, safe rejection, help, and job submission.
src/​quantum/​azext_quantum/​operations/​job.py Removes storage parameters and forwards optional arguments by keyword.
src/​quantum/​azext_quantum/​_params.py Removes job storage argument registration.
src/​quantum/​azext_quantum/​_help.py Clarifies workspace-linked storage behavior.
src/​quantum/​azext_quantum/​__init__.py Adds a pre-parse guard for removed storage options.

Review effort: Balanced

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Comment thread src/quantum/azext_quantum/__init__.py Outdated
@@ -18,6 +19,35 @@
CLI_REPORTED_VERSION = ext.version if ext else "unknown"


def _reject_removed_job_storage_argument(cli_ctx, **kwargs):

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.

this seems to be not standard practice in az cli, I would not introduce this:

  • The list of short forms (--st … --storage) is fixed in the code. If an option starting with --st is ever added to these commands, the check would block it.
  • It also duplicates the CLI's normal error output instead of using the parser's error path.

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.

Removed the custom pre-parse guard and the hardcoded abbreviation checks. The removed option now follows the standard cli unrecognized-argument path. The regression test checks exit code 2and the standard error for all three commands and both argument spellings

Comment thread src/quantum/HISTORY.rst Outdated
++++++++++++++
* [BREAKING CHANGE] Removed the ignored ``--storage`` argument from ``az quantum job submit``, ``az quantum execute``, and ``az quantum run``. Remove this argument from scripts; jobs continue to use workspace-linked storage because the backend already supports only that storage. The workspace-level ``--storage-account`` argument is unchanged.
* Updated the vendored Quantum SDK to remove explicit storage connection-string overrides and their obsolete container helpers, matching the upstream SDK change.
* Reject the removed job ``--storage`` option with migration guidance without echoing its value in the error message or command-log error entry.

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.

this describes implementation details; fold it into the first

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.

Done!

Comment thread src/quantum/README.rst Outdated
@@ -59,6 +59,18 @@ Note that the `@EntryPoint` attribute tells Q# which operation to run when the p
Prepare to submit and manage jobs in Azure Quantum using the `az quantum` extension
===================================================================================

.. important::

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.

I think we can drop this as history entry and command help already cover it

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.

Done!

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.

🔵 Needs a closer look

Managed-storage creation and ARM polling changes affect V1/V2 provisioning and RBAC, but offline-only validation leaves provisioning completion and job access to managed storage unconfirmed in a live environment.

No open issues 🎉

Review effort: Balanced

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

for command in ('quantum job submit', 'quantum run', 'quantum execute'):
for option in ('--storage legacy-storage', '--storage=legacy-storage'):
with self.subTest(command=command, option=option):
with self.assertLogs('cli.azure.cli.core.azclierror', level='ERROR') as errors:

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.

test_job_commands_reject_storage mostly checks argparse behaviour, and it depends on the internal logger name cli.azure.cli.core.azclierror. Consider removing it or keeping one simple case.

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. I removed test_job_commands_reject_Storage, including its dependency on the internal CLI logger. The removed option continues to use the standard Azure CLI unrecognized-argument handling

output_mock.assert_called_once_with(cmd, 'job-123', 'test-rg', 'test-ws')
self.assertIs(result, expected_result)

def test_submit_uses_workspace_storage(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.

test_submit_uses_workspace_storage replaces 10 functions with mocks and checks the whole request payload, so most changes to submit() will break it. The only assertion this PR needs is that Workspace(...) is created without storage. That same test imports job inside the test function while also importing submit at module level. Pick one style

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. I simplified the test to check that Workspace is called with only resource_id and credential, without a storage argument. It now stops at the sdk constructor boundary, so the upload and job-payload mocks and assertions are removed. The test also consistently uses the module-level submit import.

class QuantumWorkspaceStorageContractTest(unittest.TestCase):

@patch('azext_quantum.vendored_sdks.azure_quantum_python.workspace.WorkspaceMgmtClient')
def test_get_container_uri_uses_linked_storage(self, management_client_mock):

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.

I don't think we should add tests for azure-quantum-python dependency here - it should live in it's own repo

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, removed

@unittest.mock.patch('azext_quantum.operations.job.output')
@unittest.mock.patch('azext_quantum.operations.job.wait')
@unittest.mock.patch('azext_quantum.operations.job.submit')
def test_run_forwards_optional_arguments(self, submit_mock, wait_mock, output_mock):

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.

test_run_forwards_optional_arguments mostly repeats the implementation, maybe skip it?

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, removed

Comment thread src/quantum/azext_quantum/_help.py Outdated
Comment on lines +18 to +19
Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage
accounts are not supported.

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.

new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.

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, removed the added text from help entries

Comment thread src/quantum/azext_quantum/_help.py Outdated
Comment on lines +44 to +45
Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage
accounts are not supported.

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.

new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.

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, removed the added text from help entries

Comment thread src/quantum/azext_quantum/_help.py Outdated
Comment on lines +159 to +160
Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage
accounts are not supported.

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.

new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.

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, removed the added text from help entries

Comment thread src/quantum/HISTORY.rst Outdated
1.0.0b32
++++++++++++++
* [BREAKING CHANGE] Removed the ignored ``--storage`` argument from ``az quantum job submit``, ``az quantum execute``, and ``az quantum run``. Commands using this argument now report an unrecognized-argument error. Remove it from scripts; jobs continue to use workspace-linked storage. The workspace-level ``--storage-account`` argument is unchanged.
* Updated the vendored Quantum SDK to remove explicit storage connection-string overrides and their obsolete container helpers, matching the upstream SDK change.

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.

The second HISTORY.rst bullet (vendored SDK cleanup) is an internal detail that users won't see, consider removing it.

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, removed the sdk-cleanup bullet.

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.

🟡 Changes recommended

The new test bypasses CLI parsing, leaving rejection of both forms of the removed --storage option untested across all three affected commands.

1 open issue

Review effort: Balanced

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.

🔵 Needs a closer look

Removing three public CLI parameters triggers ParaRemove validation, and the PR lacks release-timing context needed for a maintainer to confirm compliance with the linked breaking-change policy.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@naga-nandyala

Copy link
Copy Markdown
Contributor

This is still in Draft. Moving to next milestone (Dec 2026)

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.

8 participants