Azure / Azure/azure-cli

`az snapshot create` from blob uri fails with 2.30

Open
#20,228 2 comments 5 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-observability-squad Compute feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
`az snapshot create` fails starting in version 2.30 when using a source that is a blob uri. It works on 2.29. It looks like the change in https://github.com/Azure/azure-cli/pull/19875 to determine the correct `copyStart` mode doesn't work for the blob uri source mode.

Specifically, it calls `result = parse_proxy_resource_id(namespace.source_disk or namespace.source_snapshot)` at https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/vm/_validators.py#L1643-L1644, but both `source_disk` and `source_snapshot` are not set since only `source_blob_uri` is set.

This results in an error soon after: `ERROR: 'resource_group'`

**To Reproduce**
`az snapshot create -n {name} -g {group} -l {location} --source {blobUri} --source-storage-account-id {blobStorageAccountId}`

**Expected behavior**
Snapshot creation from a blob uri works

**Environment summary**
Running in Azure Pipelines. Releases started failing when the agents upgraded to `az` version 2.30.

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.