46,284 questions
Python: How to copy data from snapshot to disk using start_copy_from_url api
Nilesh Gopale
0
Reputation points
I am using Microsoft Azure SDK for Python in project. I want to copy data from snapshot to disk. For this task I am using readable SASuri of Snapshot and writable SASuri of Manage Disk.
Here is the example I am using to transfer data.
blob_client = BlobClient.from_blob_url("https://<writable-SASUri-managed-disk>")
copy_source_url = r"https://<readable-SASUri-Azure VM disk-snapshot>"
blob_client.start_copy_from_url(copy_source_url, metadata=None, incremental_copy=False,requires_sync=True)
I am getting error:
Traceback (most recent call last):
File "c:\Users\XYZ\Desktop\temp\req.py", line 61, in <module>
copy_data()
File "c:\Users\XYZ\Desktop\temp\req.py", line 44, in copy_data
copy = target_blob.start_copy_from_url(copy_source_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XYZ\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\tracing\decorator.py", line 78, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XYZ\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_blob_client.py", line 2249, in start_copy_from_url
process_storage_error(error)
File "C:\Users\XYZ\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\response_handlers.py", line 189, in process_storage_error
exec("raise error from None") # pylint: disable=exec-used # nosec
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 1, in <module>
azure.core.exceptions.HttpResponseError: This API is not supported for the account
RequestId:c65a45e7-f01e-0010-37be-5bb82b000000
Time:2023-03-21T06:30:42.1735206Z
ErrorCode:ApiNotSupportedForAccount
Content: <?xml version="1.0" encoding="utf-8"?>
<Error><Code>ApiNotSupportedForAccount</Code><Message>This API is not supported for the account
RequestId:c65a45e7-f01e-0010-37be-5bb82b000000
Time:2023-03-21T06:30:42.1735206Z</Message></Error>
Community Center | Not monitored
Sign in to answer