Thanks for reaching out. Missing logs for Azure Function invocations can be due to several factors. One common reason is the sampling configuration in Application Insights, which is enabled by default. If the sampling rate is too low, some logs may be dropped. Check the actual sampling rate with an Analytics query to see if the TelemetrySavedPercentage is less than 100 for any telemetry type, indicating sampling is affecting log availability.
Additionally, ensure your function app is correctly configured. Verify the diagnostics in the Azure portal to confirm that the Application Insights connection settings are properly set up and that sampling is configured as intended. It's also recommended to ensure your function app is running on version 4 or higher for better log tracking.
If your function app is integrated with a virtual network, ensure the necessary ports are open for outgoing traffic, as this can also impact log generation.
Below are the reference documents on the same
https://learn.microsoft.com/en-us/troubleshoot/azure/azure-functions/monitoring/functions-monitoring-appinsightslogs
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.