none
Cannot delete blob from URI

    Question

  • Hi,

    I'd like to report a bug with latest 4.3 azure storage. When creating blob reference from URI of an existing block blob, the blob cannot be deleted.

    Sample code to reproduce:

    // create blob
    var storageAccount = CloudStorageAccount.Parse("storage connection string");
    var blobClient = storageAccount.CreateCloudBlobClient();
    var container = blobClient.GetContainerReference("test-container");
    var createBlob = container.GetBlockBlobReference("test.txt");
               
    // upload some content
    createBlob.UploadText("test");

    // get reference to the same blob using the Uri
    var deleteBlob = new CloudBlockBlob(createBlob.Uri);

    // the condition is successful
    if (deleteBlob.Exists())
    {
        deleteBlob.Delete(); // 404 Exception
    }

    Seems like a missing integration test to me. Note that the container is public, deleting the 'createBlob' reference works fine.

    Regards,

    Stevo





    Sunday, May 10, 2015 11:04 AM

Answers

All replies