How to copy a blob from one container to another container using Azure Blob storage SDK

前端 未结 2 1574
不知归路
不知归路 2021-01-20 10:48

I have been referring to the document https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python. I have not been able to find the proper APIs for

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-20 11:18

    You should take a look at start_copy_from_url method in the SDK.

    From the same link:

    # Get the blob client with the source blob
    source_blob = ""
    copied_blob = blob_service_client.get_blob_client("", '')
    
    # start copy and check copy status
    copy = copied_blob.start_copy_from_url(source_blob)
    props = copied_blob.get_blob_properties()
    print(props.copy.status)
    

提交回复
热议问题