@Upkar Singh (TATA CONSULTANCY SERVICES LTD) Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
I understand that you are not seeing any data in the Application Insights. However you are able to see the logs in the Live metrics data and the Log Analytics Workspace.
Here are some of the suggestions, which you can try:
- For a function app to send data to Application Insights, it needs to know the instrumentation key of an Application Insights resource. The key must be in an app setting named APPINSIGHTS_INSTRUMENTATIONKEY. Ensure that you have this setting.
2.Ensure that you have the APP insights and logLevel related data in host.json as shown below:
{
"version": "2.0",
"logging": {
"logLevel": {
"Host.Results": "Error",
"Function": "Debug",
"Host.Aggregator": "Trace"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"
}
}
3.Ensure that you have the relevant logging added within your application code:
logging.debug('This is a debug log.')
logging.info('This is an info log')
4.After having all the above settings, you should see the logs in APP insights as shown below:
5.Alternatively, you can also try checking the Monitor tab within the Function and clicking on the Logs tab:
6.You can also navigate to the APPInsights and Click on the Logs as shown below and query the logs:
Queries used:
traces
| where timestamp >= ago(10d)
requests
| where timestamp >= ago(10d)
Hope this helps.
If the above action plan doesn't help. Please let me know. I would be happy to assist you further.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.