I 'm saving the uri of the file in the database in this form:
https://app.blob.core.windows.net/container/Accounts/Images/acc.jpg
But to delete it I need to pass only the blob name, when I try this
CloudBlockBlob blockBlob = Container.GetBlockBlobReference(uri);
The blob's full uri
becomes:
https://app.blob.core.windows.net/container/https://app.blob.core.windows.net/container/Accounts/Images/acc.jpg
So I get 404
error (not found),
I can do some trimming to the uri
but that doesn't seem efficient.
so is there a way to delete a blob/ get reference by its full URI?
I did face similar issue , since i already had valid container reference this worked for me :
CloudBlockBlob blockblob = container.GetBlockBlobReference(new CloudBlockBlob(blobUri).Name);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With