I'm tryng to copy a blob from one container to a subfolder in the same container but i have been unable to do so. I'm using Python Azure SDK 12 and using the example provided here and in many other places as base https://stackoverflow.com/a/64285413
blob_service_client = BlobServiceClient.from_connection_string(blob_connection_str)
container_client = blob_service_client.get_container_client("mycontainer")
source_blob = container_client.get_blob_client("mycontainer", "myblob.txt")
destination_blob = container_client.get_blob_client("mycontainer", "subfolder/myblob.txt")
destination_blob.start_copy_from_url(source_blob.url)
However when i ran the last line it'd fail saying that snapshot is an invalid queryParam, and i printed out souce_blob.url and it was indeed not the url i would have expected
https://myaccount.blob.core.windows.net/mycontainer/mycontainer?snapshot=/mycontainer/subfolder/myblob.txt
So I tried constructing the url myself manually as in this example, this URL is the exact same URL i get when i go to Azure portal to get the URL for the blob: https://stackoverflow.com/a/62401832
source_blob = (f"https://myaccountname.blob.core.windows.net/mycontainer/subfolder/myblob.txt")
destination_blob.start_copy_from_url(source_blob)
but for some reason i still get the same snapshot error, i don't understand why start_copy_from_url
is passing the blob name as a snapshot param? i'm very confused by that
ErrorCode:InvalidQueryParameterValue Error:None QueryParameterName:snapshot QueryParameterValue:mycontainer/subfolder/myblob.txt
Any ideas what i'm doing wrong or how to bypass this?