Hey @Puffles ! It sounds like you're having some trouble with your Azure Function after enabling Application Insights. Here are a few things you can check and try to resolve this issue:
- Check Application Insights Configuration:
- Go to your function app in the Azure portal and navigate to Configuration. Ensure you have the
APPLICATIONINSIGHTS_CONNECTION_STRINGset up correctly. If you see theAPPINSIGHTS_INSTRUMENTATIONKEY, consider replacing it with the connection string, as the instrumentation key will be deprecated by 2025.
- Go to your function app in the Azure portal and navigate to Configuration. Ensure you have the
- Review Logs for Errors:
- Use the Application Insights logs to look for any errors. You can run a query like:
exceptions | where customDimensions.Category == "Host.Startup"
- Use the Application Insights logs to look for any errors. You can run a query like:
- Check Sampling Settings:
- Sometimes, Application Insights has a sampling feature enabled, which may lead to missing logs. To check or adjust the sampling settings, review your function app's
host.jsonfile:{ "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "maxTelemetryItemsPerSecond": 20, "excludedTypes": "Request;Exception" } } } }
- Sometimes, Application Insights has a sampling feature enabled, which may lead to missing logs. To check or adjust the sampling settings, review your function app's
- Diagnose Function App Configuration:
- Use the Diagnose and solve problems blade in the Azure portal to run Function Configuration Checks. Make sure that the settings in place for Application Insights are accurate and not overlapping.
- Look for Function Errors or Missing Invocation:
- Check to see if the function is indeed being triggered. You can use queries to verify that this is happening, like this:
traces | where message contains "Exception while executing function"
- Check to see if the function is indeed being triggered. You can use queries to verify that this is happening, like this:
- Check for Other Potential Issues:
- It's possible that the function runtime may not be starting up due to some underlying exceptions or conflicts with other apps pulling from the same queue.
If you've gone through these steps and are still facing issues, it might be helpful to provide more specific details about any error messages you are encountering or the exact configuration you applied when setting up Application Insights.
Hope this helps! Let me know if you have any further questions or need more assistance!
References:
- Enable Application Insights Integration
- Monitor Azure Functions
- Application Insights Logs are Missing or Incorrect
Note: This content was drafted with the help of an AI system.