1

After upgrading to WebJobs 0.3 beta, Azure WebJobs is calling my method (with BlobTrigger as input) multiple times when a blob is posted to storage. This happens both when testing locally at the Console, and in Azure. In my case, I am taking the BlobTrigger, and then posting to a queue, like so:

        public static void ProcessFactoryFileSubmission(
        [BlobTrigger(blobs.RESPONSE + "/{requestId}_{factoryId}_{filename}")] ICloudBlob blob,
        [Table(tables.PACKAGE)] CloudTable table,
        [Queue(queues.FACTORY_RESPONSE)] out FactoryPackageResponseMessage responseQueue)

The queue is getting two messages, and in the webjobs azure dashboard it does show the function being invoked twice.

Why is this?

2 Answers 2

3

This issues is fixed as of 0.5.0-beta. BlobTriggers are only fired when a new blob is detected or an existing blob is updated. For more information please see this post http://azure.microsoft.com/blog/2014/09/06/announcing-the-0-5-0-beta-preview-of-microsoft-azure-webjobs-sdk/

2

pianomanjh, this is a known limitation. There are a few combinations of triggers and outputs that don't play well. Let me explain how this works internally and why this case doesn't work:

Case 1: BlobTrigger (input) + Blob (output): it is easy to know if the input blob was processed by looking for the output blob, which must exist and be newer.

Case 2: QueueTrigger (input) + any output: it is easy to know if the input was processed because the queue message is deleted after it gets processed.

Case 3: BlobTrigger (input) + Queue (output): it is not very easy to know if the input blob was processed because the message in the queue might or might not exist. Also, we are not storing any metadata on the blob to know if it was processed by a particular function.

You are hitting case 3. A workaround to this is to move the blob in a different container/directory once it gets processed so it doesn't get picked again.

1
  • 2
    A known limitation to Microsoft, perhaps. I didn't see this anywhere in the blogs, docs. Practically speaking, this means BlobTrigger isn't really an option unless you're doing blob in/out. An error should likely be thrown in the dash, or a warning at a minimum, when you have otherwise. I assume Table output or ServiceBus output can be duplicated as well?
    – pianomanjh
    Jul 15, 2014 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.