azure functions multiple blob trigger functions same blob container

Chip Felton 0 Reputation points
2024-12-11T02:17:15.7133333+00:00

I have a function app (python V1) that includes multiple blob triggered functions all listening for blob triggers from the same blob container. This works on Azure, but not running locally using core tools; when running locally, whichever function is first alphabetically is the only one triggered.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Volunteer Moderator
    2024-12-11T09:54:10.8866667+00:00

    Hello @Chip Felton

    This issue you mentioned occurs because the core tools use a single host for all functions, and the host only listens to a single blob trigger per container.

    To work around this issue, you can use the host.json file to configure the host to listen to all blob triggers in the container. You can add the following configuration to the host.json file:

    {
    	"version": "2.0", 
    	"extensions": { 
    		"blobs": {
    			"maxDegreeOfParallelism": 1, 
    			"batchSize": 1, 
    			"newBatchThreshold": 0 
    		} 
    	}
    }
    

    This configuration sets the maxDegreeOfParallelism to 1, which means that the host will only process one blob trigger at a time. It also sets the batchSize and newBatchThreshold to 1, which means that the host will process each blob trigger as soon as it arrives.

    With this configuration, the host will listen to all blob triggers in the container, and all of your blob triggered functions should be triggered when a blob is added or updated in the container.

    I hope this helps.

    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.