Application Insights not showing any data when hosting in Azure App service

Ali, Jaleel 20 Reputation points
2024-03-16T17:49:01.3766667+00:00

I hosted a web api written in .net 8 in Azure app service . Also enabled the Azure Application Insights for the application in the Azure portal. When I run the application in my dev environment, the logs are written into the Azure Portal Application Insights . But, when the same app is published to Azure App Service, no logs are written even though I use same APP Insights connection string.

I tried the troubleshoot guide here https://learn.microsoft.com/en-us/troubleshoot/azure/azure-monitor/app-insights/investigate-missing-telemetry#powershell-script-send-availability-test-result , but no luck.

As part of the troubleshooting, when I run the "PowerShell script to send availability test result" in the Kudu Powershell , I get an error " Invoke-WebRequest : Unable to connect to the remote server "

Any hint to resolve the issue would be appreciated ! Thanks

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
0 comments No comments
{count} votes

Accepted answer
  1. Konstantinos Passadis 19,586 Reputation points MVP
    2024-03-17T00:38:52.82+00:00

    Hello @Ali, Jaleel

    Kindly post any ouput from the following , and also enable if available the file system logs

    aqa

    -

    aqa2

    Also i suppose that in the Environment Values aside the App Insigts API , you have an entry with the Instrumentation Key right ?

    Finally have a look here :

    https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps-net


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Konstantinos Passadis 19,586 Reputation points MVP
    2024-03-16T21:46:43.4833333+00:00

    Hello @Ali, Jaleel

    Have you seen this Documentation

    https://learn.microsoft.com/en-us/azure/azure-monitor/app/codeless-overview#supported-environments-languages-and-resource-providers

    Please compare the Table with the Environment and see whether your App is suppoted based on the ASP Service Plan

    For example Linux is not supported

    In that case you might benefit from this approach : https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=net

    Let us know your thoughts !

    --

    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    0 comments No comments

  2. Ali, Jaleel 20 Reputation points
    2024-03-17T00:10:53.9+00:00

    Hi @Konstantinos Passadis Thanks for the suggestion. My web API is written in .NET 8 and hosted in Windows Azure App Service. As per the table you sent, it should support Application insights.

    Thanks

    Jaleel

    0 comments No comments

  3. Ali, Jaleel 20 Reputation points
    2024-03-18T14:25:41.78+00:00

    error

    Please find the screenshot

    0 comments No comments

  4. Ali, Jaleel 20 Reputation points
    2024-03-19T05:00:04.72+00:00

    Looking at the above screenshot shows, there is a communication problem between App Service and App Insights service. Apparently, the issue was , the firewall was blocking the communication. Allowing this communication to go through the firewall fixed the issue. Thank you @Konstantinos Passadis for the help. Appreciate it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.