Achindra Bhatnagar
Published © MIT

Setting Permissions on Blob Storage Container

Update to previous post – "Capturing and Uploading Images to Azure Blob Storage from Universal Windows Apps"

BeginnerProtip4 hours2,118
Setting Permissions on Blob Storage Container

Things used in this project

Story

Read more

Code

Code snippet #1

C#
await HttpHandler.tempContainer.CreateIfNotExistsAsync();

BlobContainerPermissions permissions = new BlobContainerPermissions();
permissions.PublicAccess = BlobContainerPublicAccessType.Blob;
await HttpHandler.tempContainer.SetPermissionsAsync(permissions);

blob = HttpHandler.tempContainer.GetBlockBlobReference(blobFileName);
await blob.DeleteIfExistsAsync();
await blob.UploadFromFileAsync(file);

Credits

Achindra Bhatnagar

Achindra Bhatnagar

20 projects • 158 followers
Windows Kernel Hacker, IoT Hobbyist, Enthusiast, Developer and Dreamer

Comments