How can I view logs in Application Insights? - azure

I created Web application in App Service using a custom container from Azure Container Registry, enabled File System logging for it, add Application Insights for this app service. Application write logs to this app insights. But how can I see those logs in Azure portal? I open "Logs" sub-menu in Application Insights and see here "Queries". What am I doing wrong?
Why Azure can't provide just full logs in the portal?

Application Insights -> Transaction search
Here you can filter data by TRACE type and it is your application logs

Related

Is there a way for me to offload an App Service Plan to Log Analytics?

I wan to see logs of the nodes of my app service plan in Log Analytics. I DONT want to do it with app service. I need to query data of my nodes with KQL
Unfortunately, it's impossible as of now. Please vote up for this user voice: Request to manage diagnostic settings for App Service Plan from Azure portal.
I also tried from both azure portal and rest api:
From azure portal, there is no the option of Diagnostic settings for app service plan.
From api Diagnostic Settings - Create Or Update: It throws an error says that app service plan is not in the whitelist which means that it's not supported currently.
Hope Microsoft can implement this feature for service plan asap:).

Where can i see App Service azure logs in Azure Portal

I have read several docs and tutorials about Azure App Services.
What i want to do is to see my application log (errors, exceptions, etc.) in azure portal.
I have read i need to configure something in order to store my logs to a Storage account, Log analytics, or Event Hub.
But, this command line shows me the logs !
az webapp log tail --name myapp --resource-group mygroup
So there is no need to configure anything in order to collect log, if this command can do it...
How can i do the same thing in azure portal ?
And how can i see more than 10 lines with this tail ?
Thanks
I find using "Log Stream" very useful. It outputs all your logs in realtime to the portal.
You can enable logging on the app service by browsing to the app service logs section under the app service blade in the azure portal. Here is a link that shows how to do it: https://manojchoudhari.wordpress.com/2019/11/01/azure-app-service-and-diagnostics-logging/
Here is another article that shows how to enable diagnostic logging on the app service from the portal: https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs
In terms of the tailing command, the documentation doesn't have any params to do this so I doubt it you can increase the number of lines. However, you can output your logs with -o which you might already know.
When your web apps service is down you can get more details in "Diagnose and solve problems" in azure portal, you can get application logs, container issue, memory usage and other details.
https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics
If you want to debug your code deployed in app service inside azure portal then you can go to advanced tool and launch KUDU.
https://www.gslab.com/blogs/kudu-azure-web-app
Note: You need to have contributor permissions for this.

Facing issue while integrating Azure Application Insights with Azure API Management instance

I have created an Azure Application Insights instance with the Application Type as General.
But when I try to integrate the Application Insight with an API Management service Instance through Monitoring -> Application Insights -> Add options in APIM instance, I am not getting any data of the Application Insights instances in the dropdown.
This is happening even though the APIM Instance and Application Insights locations are same.
Looks like this is a bug in the APIM Portal in Azure. To work around, go to
Directory + Subscription (at the top right corner of the portal window) and select only the subscription under which the App Insight resource was created.
Now, go back and try adding the Application Insights, you will see all the app insight resources that belongs to the selected subscription.

Setting up run-time Application Insights on a Cloud Service

According to Microsoft's documentation, Application Insights is best deployed both at build time and run-time, and can be installed at run-time by "select[ing] Application Insights on the app's control panel in Azure". But I don't see it on the configuration for Cloud services, at least not in the new portal:
Is the documentation incorrect (necessitating the long process laid out elsewhere on SO still required)? If not, where should I be looking?
EDIT 3 You can supposedly set it while publishing from Visual Studio (if you upgrade the Azure SDK to 2.9 and "Add Diagnostic Configuration" in Visual Studio for the project):
but it still insists I download the Status Monitor:
In the Azure Portal, currently there is no Application InSights on the Cloud Service control panel. We could find the Application InSights on the Azure App Service. Azure App Service and Cloud Service are different services in Azure. The difference between Azure AppService and CloudService please refer to Azure App Service, Virtual Machines, Service Fabric, and Cloud Services comparison.
"select[ing] Application Insights on the app's control panel in Azure"
In the document that you mentioned, it is for Azure App service
Select Application Insights in the Azure control panel for your web app
For Cloud Service, please refer to document, there are more detail steps about how to setup Application Insights for each role .

How to display azure app service's web server log on Azure log Analytics?

I have an api application hosted on azure App services. For the web server log (iis logs) I've turned on web server logging from Azure portal. Look at the screenshot below.
For storing web server logging
Server Logs are allowed to be stored on the Azure blob containers only. As per the configuration the logs are stored on blob container as expected. Now I want to use these logs to be displayed on Azure Log Analytics.
I've the following storage configurations on Log Analytics in Azure Web portal.
On Log Analytics explorer I can view logs from all other sources except the web server (iis logs). What I'm missing here?
Verified with App Services team that Log Analytics is only supported at the IaaS (VM) level, not at PaaS (App Service) level.
Hopefully we can get this on their roadmap soon - for now you have to manually ingest this data into an external log management tool (Splunk, Sumo Logic, Azure Data Explorer).
Update 12/02/2019
Azure App Service has announced a Public Preview for IIS App Log integration with Azure Log Analytics.
Expanding on the prior answer, under the Diagnostic settings (preview) pane you can now integrate multiple logs to Azure via Add diagnostics setting, this can store:
AppServiceAntivirusScanAuditLogs
AppServiceHTTPLogs
AppServiceConsoleLogs
AppServiceAppLogs
AppServiceFileAuditLogs
AppServiceAuditLogs
AppServiceIPSecAuditLogs
AppServicePlatformLogs
AllMetrics
You can send them to:
Log Analytics workspace
Archive to storage account
Stream to event hub
Send to partner solution
Additionally, Application Insights is migrating to be backed by Log Analytics so we are getting close to fully integrated platform for metrics and logs

Resources