3
votes

How do I create a copy of an existing file in an Azure Blob Storage container using code? I'm using the WindowsAzure.Storage NuGet package to handle all operations related to my Azure Blob Storage.

To be 100% clear, I'm trying to create a complete and separate copy of a file that's already been uploaded to a container on Azure Blob Storage. I also want to give the file a new name in the process.

2

2 Answers

2
votes

Purely in code, you'll want to use StartCopyAsync() a method on CloudBlockBlob, to start the copy process.

1
votes

One simple way is to use a logic app that triggers on a blob being created that will then copy the blob.

https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-azureblobstorage

If you want to get more sophisticated, you can do a function app.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function