3

I have the following functions in the same web job console app that uses the azure jobs sdk and its extensions. The timed trigger queries an API end point for a file, does some additional work on it and then saves the file to the blob named blahinput. Now the second method "ProcessBlobMessage" is supposed to identify the new blob file in the blahinput and do something with it.

public static void  ProcessBlobMessage([BlobTrigger("blahinput/{name}")] TextReader input,
        string name, [Blob("foooutput/{name}")] out string output)
    {//do something        }

    public static void QueryAnAPIEndPointToGetFile([TimerTrigger("* */1 * * * *")] TimerInfo timerInfo) { // download a file and save it to blob named blah input}

The problem here is : When I deploy the above said web job as continuous, only the timer triggered events seems to get triggered while the function that is supposed to identify the new file never gets triggered. Is it not possible to have two such triggers in the same web job?

Jaya
  • 3,721
  • 4
  • 32
  • 48

2 Answers2

2

From this article: How to use Azure blob storage with the WebJobs SDK

The WebJobs SDK scans log files to watch for new or changed blobs. This process is not real-time; a function might not get triggered until several minutes or longer after the blob is created. In addition, storage logs are created on a "best efforts" basis; there is no guarantee that all events will be captured. Under some conditions, logs might be missed. If the speed and reliability limitations of blob triggers are not acceptable for your application, the recommended method is to create a queue message when you create the blob, and use the QueueTrigger attribute instead of the BlobTrigger attribute on the function that processes the blob.

Thomas
  • 24,234
  • 6
  • 81
  • 125
  • Thank you for the quick reply! Sure will refactor my code a bit to try using queues for better reliability and also did come across configuring queue processing settings that might help me set polling and batchsize as well. Thanks again! – Jaya Apr 08 '16 at 16:20
  • 1
    @JS_GodBlessAll. Here is a good starting point to deal with queue https://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-storage-queues-how-to/ – Thomas Apr 10 '16 at 21:33
0

Until the new blob trigger strategy is released, BlobTriggers are not reliable. The trigger is based on Azure Storage Analytics logs which stores logs on a Best-Effort basis. There is an ongoing Github issue about this and there is also a PR regarding a new Blob scanning strategy.

This being said, check if you are using the Latest Webjobs SDK version 1.1.1 because there was an issue on prior versions that could lead to problems on BlobTriggers.

Matias Quaranta
  • 13,907
  • 1
  • 22
  • 47