Function App Blob trigger only works when i open Log Stream in the Portal

Shubham Tomar 1 Reputation point
2022-10-12T07:14:45.917+00:00

I am facing problem with Azure Function Apps.
I have publish/Deploy the Function App in python fron Visual Studio Code by using deploy option available next to fuction directly. It works fine locally.
I have not set any time to trigger blob storage. Instead I just want, when I upload a file to azure blob storage, the function app triggers the blob immediately. It works fine when I log in to Function App's Log stream Portal, but when I log off or close the log stream in Function App Portal the Function App doesn't trigger the blob.

Kindly, please help me.
Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shubham Tomar 1 Reputation point
    2022-10-12T09:25:23.503+00:00

    Now I got it:-

    Polling and latency
    Polling works as a hybrid between inspecting logs and running periodic container scans. Blobs are scanned in groups of 10,000 at a time with a continuation token used between intervals. If your function app is on the Consumption plan, there can be up to a 10-minute delay in processing new blobs if a function app has gone idle.

    Solutions:-
    If you require faster or more reliable blob processing, you should instead implement one of the following strategies:

    • Change your binding definition to consume blob events instead of polling the container. You can do this in one of two ways:
      • Add the source parameter with a value of EventGrid to your binding definition and create an event subscription on the same container. For more information, see Tutorial: Trigger Azure Functions on blob containers using an event subscription.
      • Replace the Blob Storage trigger with an Event Grid trigger using an event subscription on the same container. For more information, see the Image resize with Event Grid tutorial.
    • Consider creating a queue message when you create the blob. Then use a queue trigger instead of a blob trigger to process the blob.
    • Switch your hosting to use an App Service plan with Always On enabled, which may result in increased costs.

    It's mentioned in the documentation itself https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-python

    If you have suggestions, welcome.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.