Search code examples
azureazure-functionsazure-app-service-plansazure-durable-functions

Azure Function long duration and App Service Plan, Durable function


Im preparing AZ-204 certification.

We want to execute a function during a long time. the solution (in Microsoft docs) is to use App service plan or durable functions

In one practice test i found a confusing response of the question below:

"You develop an HTTP triggered Azure Function app to process Azure Storage blob data. The app is triggered using an output binding on the blob. The app continues to time out after four minutes. The app must process the blob data. You need to ensure the app does not time out and processes the blob data." Proposed answers:

Solution1: Configure the app to use an App Service hosting plan and enable the Always On setting. Should be YES or NO??

Solution2: Use the Durable Function async pattern to process the blob data. Should be YES or NO ??

Solution3: Pass the HTTP trigger payload into an Azure Service Bus queue to be processed by a queue trigger function and return an immediate HTTP success response. Should be YES or NO ??

according to what I have prepared the three answers are correct. Who can confirm?


Solution

  • I dont fully understand the trigger for the function. From the text it seems to be a HTTP trigger and a blob trigger?? But I will make the assumption that it is a HTTP trigger that does some work with blob data for over 4 minutes. For this case the correct answer would be NO, YES, YES imo.

    Solution 1: https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout Whatever the app service plan the maximum timeout for HTTP triggers is 230 seconds.

    Solution 2: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp#async-http I would consider this to be true if you return an immediate response as said from the docs for this pattern. I have used durable funtions quite a bit and it would definitely be able to solve the problem and also allows checking status, canceling very easily.

    Solution 3: Since we seperate out our work from the HTTP function to Queue it is able to run for 10-infinity (dependning on plan) so this would also be considered correct. A key concept of functions and is the ability to seperate out work and queues are the most common approach. Architecturally I would probably prefer this method but durable functions work aswell.

    Please ask if you have any questions that needs clarification and good luck with the exam.