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

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

Related

Can you query the ApiManagementGatewayLogs in Azure using Invoke-AzOperationalInsightsQuery?

I want to query the ApiManagementGatewayLogs table for an API Management service in Azure using Invoke-AzOperationalInsightsQuery. I can query Log Analytics workspaces fine with this command. I am not able to do this with API Management because I cannot find the workspace ID.
In API Management service, the Logs blade (under "Monitor") uses the Log Analytics icon and it leads you to think it may have a workspace underlying it. Having this workspace would let me call Invoke-AzOperationalInsightsQuery with the subscription plus workspace values. I think. Right now, I don't know if there is a workspace associated to the API Management service or if it is a munged storage that gets created with a Log Analytics icon.
Looking at the dedicated Log Analytic workspaces reveals that none have the ApiManagementGatewayLogs table that is found in the API Management service. So it looks like there is no connection between the API Management service and an existing Log Analytics workspace.
If there is no way to query API Management using Invoke-AzOperationalInsightsQuery, is there some Powershell equivalent for querying an API Management service using KQL?
I found the solution to this.
In API Management blade, there is a "Diagnostics settings" link under the Monitoring section.
Your logs will need to be set up here for storage in a storage account, Log Analytics workspace, event hub or partner solution.
If you are using a Log Analytics workspace, then this will be the workspace you use when invoking the Invoke-AzOperationalInsightsQuery Powershell command.
The APIM will ship your ApiManagementGatewayLogs table to the workspace configured in Diagnostic settings.

How can I view logs in Application Insights?

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

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:).

How to upload custom metrics and metrics data on azure that can be seen on Azure Management Portal in Diagnostics Monitor

I am working on an application with requirement of insert/upload data on azure that can be seen on Azure Management Portal in Diagnostics Monitor/dashboard
that shows performance counter data in form of graphs, charts.
I want to know how to upload data on azure.
How to see uploaded data in Azure Management Portal Diagnostics Monitor/dashboard (in form of graphs/charts)
Can this be done by creating custom metrics? If yes, how to create custom metrics and monitor? Can it be done using REST API?
If it is not possible to upload and view my own data on Azure Management Portal - Diagnostics Monitor (graph, chart) using custom monitor the is it possible at all to upload and view my own data in Azure Management Portal - Diagnostics Monitor/dashboard?
I am new to Azure. Please suggest if this is possible.
You need to configure Azure Diagnostics. The process is described here for Azure Cloud Services and Virtual Machines:
https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-diagnostics-for-cloud-services-and-virtual-machines/

DiagnosticMonitorTraceListener in Azure Websites

I have been using Azure Cloud Services the past year and is used to reading my trace logs with Azure Management Studio, with logs being stored in table storage using DiagnosticMonitorTraceListener.
I am confused about starting using azure websites as it seems they are using a diffrent logging structure? Is it not possible to see the trace logs from azure website using azure management studio in the Diagnostic/Trace like i used to with Cloud Services
Diagnostics in azure websites is similar to any web application. DiagnosticsMonitor applies to webroles. In the case of websites, diagnostics need to have a persistent storage and it can be configured in azure management portal.
Check out these posts.
http://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-diagnostics/
http://blogs.msdn.com/b/microsoft_press/archive/2014/01/29/from-the-mvps-diagnostics-and-logging-in-windows-azure-web-sites.aspx
http://www.hanselman.com/blog/StreamingDiagnosticsTraceLoggingFromTheAzureCommandLinePlusGlimpse.aspx
The logs can be downloaded and analysed locally. I am not sure if the tool that supported webroles works for this too.
The diagnostics viewer tool for cloud services will not work for Azure Websites, but there is a tool for viewing your Azure Website logs called Azure Website Log Browser. It is installed as a site extensions on your Azure Website.
You can read more about it here.

Resources