Synchronous az blob storage copy fails for PageBlobs
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Describe the bug**
Using the `requires-sync` parameter causes copy operation to fail when blob type is a PageBlob. So, if you run a copy operation on a PageBlob (example: A VHD created by packer via it's `azure-vhd` builder) with `requires-sync` _NOT_ set like this:
```
az storage blob copy start --destination-blob "$prod_vhd_filename" \
--destination-container bnbnb --account-name yuny \
--account-key "$prod_blob_storage_key" --source-uri "$dev_vhd_id"
```
The response is a JSON object with details like
```
{
"completionTime": null,
"id": "redacted",
"progress": null,
"source": null,
"status": "pending",
"statusDescription": null
}
```
But, if you include the `requires-sync` param in your copy start call like below:
```
az storage blob copy start --destination-blob "$prod_vhd_filename" \
--destination-container bnbnb--account-name yuny \
--requires-sync true \
--account-key "$prod_blob_storage_key" --source-uri "$dev_vhd_id"
```
An error with the following issue is reported:
```
The copy source must be a block blob. ErrorCode: CannotVerifyCopySource
CannotVerifyCopySourceThe copy source must be a block blob.
RequestId:xxyyxx
Time:2020-05-13T12:11:20.8982539Z
```
**To Reproduce**
1. Ensure you have a Storage Blob Container with a blob of type PageBlob
2. Copy this blob of type PageBlob to another Storage Blob Container on another account using the commands described above with the `requires-sync` param set to true
3. This fails and cancels the Copy operation
**Expected behavior**
1. When a copy operation for a page blob happens across storage accounts with the `requires-sync` param set to `true`, the copy operation shouldn't error and cancel itself
**Environment summary**
1. OS -> linux
2. Shell -> bash
3. Install method -> interactive script
`az --version`
```
azure-cli 2.5.1
command-modules-nspkg 2.0.3
core 2.5.1
nspkg 3.0.4
telemetry 1.0.4
Python location '/opt/az/bin/python3'
Extensions directory '/root/.azure/cliextensions'
Python (Linux) 3.6.5 (default, Apr 30 2020, 06:22:25)
[GCC 8.3.0]```
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.