0

I have an Azure function which is triggered by changes in the blob.

    [FunctionName("...")]
    public static void Run([BlobTrigger("...", Connection = "")]Stream myBlob, string name, ILogger log)
    {
       var processor = new ProcessBusiness(....);
       processor.CallA();

       CallB();
    }

There is a function called CallA() In that function, I make a call to a stored procedure which takes a lot of time to execute and I expect the function CallB() to be executed when CallA() finishes.

But it does not behave like this. It seems like it actually skips the heavy process and put some messages in some auto-created queue and execute the main function to the end and will get back again to handle the heavy part afterward based on the generated queue that I mentioned above.

How should I deal with this situation since I need CallB to be executed after CallA? Thanks

pjs
  • 18,696
  • 4
  • 27
  • 56
sishanov
  • 141
  • 2
  • 9
  • Are you sure the function isn't terminating prematurely because it times out? Functions can only go so long. There's a way to configure their timeout, so look into that. There are also durable functions that can run even longer. Also, is it possible that CallA isn't modifying the blob again, triggering a new function instance to run? – Slothario Dec 04 '19 at 17:26
  • Also, I would again ask you if using functions is absolutely essential here. The point of functions is automatic scalability, but there are big complications that arise from that, especially if your database isn't instantly, automatically scalable (which it probably isn't). – Slothario Dec 04 '19 at 17:29
  • @Slothario there are plenty of issues I have: 1. BlobTrigger does not wait for files to be copied completely and once the file is created the function triggered – sishanov Dec 04 '19 at 17:39
  • @Slothario I don't have any problem with timeout and database it is actually pretty well structured DB – sishanov Dec 04 '19 at 17:40

0 Answers0