How do I rename or copy a blob using Azure's Golang SDK?

2023-10-06T00:28:57.89+00:00

Is there an API in the Azure SDK for Go that allows me to rename/copy blobs? I've seen CopyFromBlob() being called in overflow.com but it doesn't appears to exist in Azure SDK for Go.

I've seen the DownloadStream() and UploadStream() APIs but it appears that the blob is first downloaded from Azure cloud and uploaded back to the cloud. Are these the only APIs that supports rename/copy of blobs in Azure SDK for Go?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,721 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amrinder Singh 2,515 Reputation points Microsoft Employee
    2024-05-01T10:46:28.9933333+00:00

    Hi Nacional, Anthony B - Raleigh, NC - Contractor - Thanks for reaching out over Q&A Forum!

    Can you try StartCopyFromURL method to see if that helps. There is an example for the same as well

    https://pkg.go.dev/github.com/Azure/azure-storage-blob-go/azblob

    https://pkg.go.dev/github.com/Azure/azure-storage-blob-go/azblob#example-BlobURL-StartCopy

    Please let us know if you have any further queries. I’m happy to assist you further.    


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments