Skip to content

Safely unwrapping of enum object#10055

Open
vlkhomenko wants to merge 4 commits into
Azure:mainfrom
vlkhomenko:quatum-workspace-sku-fix
Open

Safely unwrapping of enum object#10055
vlkhomenko wants to merge 4 commits into
Azure:mainfrom
vlkhomenko:quatum-workspace-sku-fix

Conversation

@vlkhomenko

@vlkhomenko vlkhomenko commented Jun 30, 2026

Copy link
Copy Markdown

Safely unwrapping of enum object into its plain string value, or passes the value through unchanged if it's already a plain type.
ARM deployment templates require plain string values, not enum objects. Passing an enum directly would cause serialization errors.

Currently, tests get SkuName.Standard_LRS value instead of Standard_LRS that causes test failures.


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

…es the value through unchanged if it's already a plain type.

ARM deployment templates require plain string values, not enum objects. Passing an enum directly would cause serialization errors.
Copilot AI review requested due to automatic review settings June 30, 2026 19:47
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 30, 2026

Copy link
Copy Markdown
️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @vlkhomenko,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@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 Jun 30, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution @vlkhomenko! 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.

Pull request overview

This PR updates the Quantum workspace creation flow to ensure ARM-template deployment parameters use plain (JSON-serializable) primitive values instead of SDK enum objects, preventing serialization issues and test failures.

Changes:

  • Added a helper to unwrap enum-like values to their underlying primitive.
  • Applied the helper when extracting storage account SKU name/tier and kind from an existing storage account for ARM deployment parameters.

Comment thread src/quantum/azext_quantum/operations/workspace.py Outdated
vlkhomenko and others added 3 commits June 30, 2026 12:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ployment parameters use plain (JSON-serializable) primitive values instead of SDK enum objects, preventing serialization issues and test failures.
@vlkhomenko

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

@rigidit

rigidit commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 10055 in repo Azure/azure-cli-extensions

@yonzhan yonzhan requested a review from necusjz July 1, 2026 00:52
@yonzhan

yonzhan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

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

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants