Draft
fix(ml): handle workspace stuck in soft-deleted state for permanently-delete and create commands#10127
Conversation
|
Hi @copilot, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
wangzelin007 and
yonzhan
July 21, 2026 02:25
Collaborator
|
ML |
…te commands - In ml_workspace_delete: when permanently_delete=True and the workspace is not found via the SDK's get() (i.e. already soft-deleted), fall back to calling the underlying REST API directly with force_to_purge=True. This allows users to purge an already-soft-deleted workspace that was blocking operations like workspace creation with the same name. - In ml_workspace_create: emit a helpful warning when the creation failure looks like it was caused by a soft-deleted workspace with the same name, pointing the user to 'az ml workspace delete --permanently-delete'. - Update help text for 'ml workspace delete' and the --permanently-delete flag to document the soft-deleted workspace purge scenario. Fixes: Azure ML workspace stuck in soft-deleted state (#10126)
Copilot
AI
changed the title
[WIP] Fix Azure ML workspace soft-deleted state issue
fix(ml): handle workspace stuck in soft-deleted state for permanently-delete and create commands
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az ml workspace delete --permanently-delete/az ml workspace createProblem
When a workspace is soft-deleted, the ARM
GETendpoint returns 404 for it. The SDK'sbegin_delete()callsself.get(name)first — soaz ml workspace delete --permanently-deleteon an already-soft-deleted workspace always fails with "workspace not found" before the actual purge REST call is made. This also blocksaz ml workspace createwith the same name, with no guidance on how to unblock it.Changes
workspace.py— core fix:ml_workspace_delete: catchResourceNotFoundErrorfrombegin_deleteseparately. When--permanently-deleteis set and the workspace is not reachable viaget()(already soft-deleted), fall back to calling the underlying REST operation directly withforce_to_purge=True, bypassing the SDK's pre-flightget()check:ml_workspace_create: on failure, emit a targetedWARNINGwith the exact purge command when the error resembles a soft-delete conflict (keywords:soft,deleted,conflict,already exists):_help/_workspace_help.py/_params/_workspace_params.py— updated help text forml workspace deleteand--permanently-delete/-pto document the soft-deleted workspace purge scenario.This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)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.jsonautomatically.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.