Hello dotnet_guy,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Problem
I understand regarding your scenarios that your C#.NET 8 Azure function triggered by Event Hub and not executing as expected.
Solution
So far, if your Azure Function triggered by Event Hub isn't executing as expected, I don't think you need to guess or leave any stone untouched. If all you've done to troubleshoot are correct and you're sure, then:
- Create a new consumer group in your Event Hub and use it in your Azure Function. Sometimes using the default consumer group can lead to unexpected behavior. Verify that your function is using the correct consumer group in the
function.json
configuration. - Understand how Event Hubs scale in your chosen plan (Consumption or Premium). For Consumption and Premium plans, scaling decisions are based on Target Based Scaling. Ensure your configuration aligns with your expected load. https://learn.microsoft.com/en-us/answers/questions/1234971/azure-function-not-triggering-when-deployed-but-wo
- Although you reverted back to logging only to App Insights, ensure that there are no lingering configurations or dependencies related to Splunk. Double-check your deployment files and settings.
- Monitor your Function App using Azure Monitor. Check for any anomalies, spikes, or patterns. Use Application Insights to track function executions, dependencies, and exceptions. Set up custom metrics if needed.
- Consider implementing retry policies in your function to handle transient errors. You can use built-in retry attributes or implement custom retry logic.
- Finally, If you need access to event metadata (such as enqueued time, sequence number, etc.), bind to an
EventData
object in your function. You can also use binding expressions in the method signature to access these properties
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam