Developing with Azure Blob Storage

Storing unstructured data such as documents, images or videos is simple with Azure Blob Storage

azcopy copy <item><sastoken> <target_container_url><target_sas_token>
Microsoft.Azure.Storage.Blob
Micorsoft.Azure.Storage.Common
string fileName = "file.txt";
AppSettings appSettings = AppSettings.LoadAppSettings();
CloudBlobClient sourceClient = Common.CreateBlobClientFromAccountAndKey(               appSettings.SourceAccountName,               appSettings.SourceSASToken);CloudBlobClient destinationClient = Common.CreateBlobClientFromAccountAndKey(               appSettings.DestinationAccountName,              appSettings.DestinationSASToken);
var sourceContainer = sourceClient.GetContainerReference(                appSettings.SourceContainerName);var destinationContainer = destinationClient.GetContainerReference(                appSettings.DestinationContainerName);
var sourceBlob = sourceContainer.GetBlockBlobReference(fileName);            var destinationBlob = destinationContainer.GetBlockBlobReference(fileName);             await destinationBlob.StartCopyAsync(sourceBlob);
await sourceBlob.DeleteAsync();

--

--

Customer Engineer at Microsoft working in the Fast Track for Azure team. GitHub: https://github.com/willvelida

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store