Azure Function Is Not Triggered Locally
Solution 1:
In additional to Mikhail, other option is to create a separate consumer group of the Event Hub for each environment such as a cloud and development/VS and configured them in the Application settings or local.settings.json. Then add the ConsumerGroup = "%consumergroup%" to the EventHubTrigger argument in your function, where the consumergroup is an example of the variable name in the settings.
Beside the above options, still you have a capability for testing a non-Http trigger function locally using a Http POST request. In other words, your function can be tested locally the same way like is done in the portal. More details here.
The following is an example of the testing EventHubTrigger function using a Http POST request:
url: http://localhost:7071/admin/functions/MyFunction
payload:
{
"input": '{"Id":1234,"Name":"abcd"}'
}
Solution 2:
Event Hub consumer information (checkpoints) are stored in Blob Storage. If you share the connection string to Blob Storage between development / production environments, they will use the same checkpoints, so they will compete against each other.
My guess is that your cloud deployment always processes the events, updates the checkpoint to the latest position, and then local deployment takes this checkpoint and doesn't do anything.
To make sure this doesn't happen, create an additional "dev" Blob Storage and set the local connection string setting to that storage.
Post a Comment for "Azure Function Is Not Triggered Locally"