I'm investigating the webhooks / event triggers available for Azure Storage. Unfortunately the documentation seems preoccupied with showing how to get the Azure portal to build the function for me, which doesn't permit local testing.
In particular, I'm looking into capturing when a blob has been deleted.
Example of my usage (an Azure Function):
[FunctionName("BlobDelete")]
public static async Task Run([BlobTrigger("...")]
CloudBlockBlob blob,
string name,
TraceWriter log)
{
;
}
The problem arises when I delete a blob from the storage container: the function is not triggered.
However, I found that if I hit CTRL+C in the console then the function is triggered.
Can anyone explain why? Is my usage wrong?
Also, I was unable to find any documentation for the BlobDelete trigger, I could only find BlobInput, BlobOutput and BlobCopy. I took a guess with BlobDelete and it... half works.
The BlobTrigger does not fire on deleted blobs, just on new / modified blobs.
Alternatives include (listed in recommended order):
Blob Trigger does not react on deleted blobs. If you need that, you should have a look at Event Grid trigger with blog events.
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