--- id: web-apps title: Azure Web Apps sidebar_label: Azure Web Apps description: The Sumo Logic app for Azure Web Apps allows you to collect Azure web server and application diagnostics logs and monitor the health of your Azure Web Apps environment. slug: /help/docs/integrations/microsoft-azure/web-apps/ canonical: https://www.sumologic.com/help/docs/integrations/microsoft-azure/web-apps/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; Web Apps icon The Azure Web Apps app allows you to collect Azure web server and application diagnostics logs and monitor the health of your Azure Web Apps environment. This app provides preconfigured dashboards that allow you to monitor server operation, traffic requests, and response times. For more information, see [Azure Web Apps](https://azure.microsoft.com/en-us/services/app-service/web/). ## Log and metric types For Azure Web Apps, you can collect the following logs and metrics: - **Resource logs**, which provide an insight into operations that were performed within an Azure resource. For a complete schema for resource logs refer to the below documentation: * [Web Server Logging](http://msdn.microsoft.com/library/windows/desktop/aa814385.aspx) * [Application Diagnostics Logs](http://msdn.microsoft.com/library/windows/desktop/aa814385.aspx) * [Activity logs](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log-schema) * [AppServiceAuditLogs](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appserviceauditlogs) * [AppServiceFileAuditLogs](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appservicefileauditlogs) * [AppServiceIPSecAuditLogs](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appserviceipsecauditlogs) * [AppServicePlatformLogs](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appserviceplatformlogs) * [AppServiceAntivirusScanAuditLogs](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appserviceantivirusscanauditlogs) - **Activity logs**, provides insight into any subscription-level or management group level events that have occurred in the Azure. To learn more, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log-schema). * **Metrics** are available in [Microsoft.Web/sites](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-web-sites-metrics) namespace. For more information on supported metrics, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/app-service/monitor-app-service-reference). ### Sample log messages ```json 2017-09-25 23:27:36 eShopCart GET / X-ARR-LOG-ID=9b3056e8-21d5-43f7-8fd7-4aec6b29525e 80 - 60.4.192.44 Mozilla/5.0+(Macintosh+NT+6.3;+WOW64)+AppleWebKit/537.36+(KHTML, +like+Gecko)+Chrome/60.4.192.44+Safari/537.36 PHPSESSID=tv2iv6tn8c9su542l464ibaro5; +ARRAffinity=d6c6606b1a249bd37139b09d6c2cb4dd61f6b5cd607f934012aca86bd59515444 - eShopCart.azurewebsites.net 200 0 0 3098 1008 1000 ``` ### Sample queries ```sumo title="Traffic over time outlier" _sourceCategory=Azure/Web-app | parse regex "\d+-\d+-\d+ \d+:\d+:\d+ (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+) (?\S+)" | timeslice 5m | count by _timeslice | outlier _count ``` ## Setup Azure service sends monitoring data to Azure Monitor, which can then [stream data to Eventhub](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/stream-monitoring-data-event-hubs). Sumo Logic supports: * Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/). * Activity Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/). It is recommended to create a separate source for activity logs. If you are already collecting these logs, you can skip this step. * Metrics collection using our [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source). You must explicitly enable diagnostic settings for each web app that you want to monitor. You can forward logs to the same event hub provided they satisfy the limitations and permissions as described [here](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=portal#destination-limitations). When you configure the event hubs source or HTTP source, plan your source category to ease the querying process. A hierarchical approach allows you to make use of wildcards. For example: `Azure/WebApps/Logs`, `Azure/WebApps/Metrics`. ### Configure collector Create a hosted collector if not already configured and tag the `tenant_name` field. You can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name). Make sure you create the required sources in this collector.
Azure Tag Tenant Name ### Configure metrics collection import MetricsSource from '../../reuse/metrics-source.md'; ### Configure logs collection #### Diagnostic logs In this section, you will configure a pipeline for shipping diagnostic logs from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) to an Event Hub. 1. To set up the Azure Event Hubs source in Sumo Logic, refer to the [Azure Event Hubs Source for Logs](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/). 2. To create the **Diagnostic setting** in the Azure portal, refer to the [Azure documentation](https://learn.microsoft.com/en-gb/azure/data-factory/monitor-configure-diagnostics). Perform the below steps for each Azure WebApps that you want to monitor. 1. Choose `Stream to an event hub` as the destination. 1. Select `HTTP logs`, `App Service Console Logs`, `App Service Application Logs`, `Access Audit Logs`, `IPSecurity Audit logs`, `App Service Platform logs`, `Report Antivirus Audit Logs`, `Site Content Change Audit Logs`. 1. Use the Event Hub namespace and Event Hub name configured in previous step in destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.
Azure WebApps logs 3. Tag the location field in the source with right location value.
Azure WebApps Tag Location #### Activity logs (optional) import ActivityLogs from '../../reuse/apps/azure-activity-logs.md'; ##### Enabling Microsoft Defender for Cloud For Security events, make sure you enable [Microsoft Defender for Cloud](https://learn.microsoft.com/en-us/azure/defender-for-cloud/tutorial-enable-app-service-plan#enable-the-defender-for-app-service-plan). In Defender Plans Settings page toggle the App Service status under Cloud Workload Protection section. Edit Settings Cloud Defender Plans ##### Enabling health check metric For getting health check metric, make sure you enable **Health check** under the **Monitoring** dropdown. Enable Health Check Metric ## Installing the Azure Web Apps app This section provides instructions on how to install the Azure Web Apps app, and shows examples of each of the preconfigured dashboards you can use to analyze your data. import AppInstallIndexV2 from '../../reuse/apps/app-install-index-option.md'; As part of the app installation process, the following fields will be created by default: - `tenant_name`. This field is tagged at the collector level. You can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name). - `location`. The region to which the resource name belongs to. - `subscription_id`. ID associated with a subscription where the resource is present. - `resource_group`. The resource group name where the Azure resource is present. - `provider_name`. Azure resource provider name (for example, Microsoft.Network). - `resource_type`. Azure resource type (for example, storage accounts). - `resource_name`. The name of the resource (for example, storage account name). - `service_type`. Type of the service that can be accessed with a Azure resource. - `service_name`. Services that can be accessed with an Azure resource (for example, in Azure Container Instances the service is Subscriptions). ## Viewing Azure Web Apps dashboards import ViewDashboardsIndex from '../../reuse/apps/view-dashboards-index.md'; ### Overview The **Azure WebApps - Overview** dashboard provides comprehensive information of all the service health incidents or resource health events associated with Azure WebApps in your azure account. Use this dashboard to: * View recent resource and service health incidents. * View distribution of service and resource health by incident type. Azure WebApps Overview dashboard ### Antivirus Scan Audit The **Azure WebApps - Antivirus Scan Audit** dashboard provides detailed insights into the antivirus scan results and audit logs associated with your Azure WebApps. Use this dashboard to: * View recent antivirus scan results and their statuses. * Analyze audit logs for compliance and security checks. Azure WebApps health dashboard ### Content and Client Platform The **Azure WebApps - Content and Client Platform** dashboard offers an overview of the content delivery performance and client platform statistics for your Azure WebApps. Use this dashboard to: * Monitor content delivery metrics and client platform usage. * Identify trends in client platform access and performance. Azure WebApps health dashboard ### IP Restrictions The **Azure WebApps - IP Restrictions** dashboard provides insights into the IP address restrictions configured for your Azure WebApps. Use this dashboard to: * View configured IP restrictions and their statuses. * Monitor access attempts based on IP restrictions. Azure WebApps health dashboard ### Memory The **Azure WebApps - Memory** dashboard tracks memory usage and performance metrics for your Azure WebApps. Use this dashboard to: * Monitor real-time memory utilization and trends. * Identify memory-related performance issues and bottlenecks. Azure WebApps health dashboard ### Network The **Azure WebApps - Network** dashboard offers comprehensive insights into the network performance and traffic for your Azure WebApps. Use this dashboard to: * Analyze network traffic patterns and performance metrics. * Identify potential network issues affecting your applications. Azure WebApps health dashboard ### I/O Operations The **Azure WebApps - I/O Operations** dashboard provides a comprehensive view of the I/O operational metrics and activities associated with your Azure WebApps. Use this dashboard to: * Monitor I/O operational events and their impact on service availability. * Analyze trends in operational performance over time. Azure WebApps health dashboard ### OS Statistics The **Azure WebApps - OS Statistics** dashboard presents an overview of operating system metrics related to your Azure WebApps. Use this dashboard to: * Monitor key OS performance indicators and health metrics. * Identify potential issues at the operating system level. Azure WebApps health dashboard ### Platform The **Azure WebApps - Platform** dashboard provides insights into the underlying platform performance and configurations of your Azure WebApps. Use this dashboard to: * Monitor platform health metrics and configurations. * Identify trends and issues related to platform performance. Azure WebApps health dashboard ### Errors The **Azure WebApps - Errors** dashboard details the error rates and response codes generated by your Azure WebApps. Use this dashboard to: * Analyze error trends and response code distribution. * Identify common issues affecting application performance. Azure WebApps health dashboard ### Server Operations The **Azure WebApps - Server Operations** dashboard tracks request and response times for your Azure WebApps. Use this dashboard to: * Monitor performance metrics related to request and response times. * Identify latency issues and optimize response performance. Azure WebApps health dashboard ### Traffic Insights The **Azure WebApps - Traffic Insights** dashboard provides a comprehensive view of traffic patterns for your Azure WebApps. Use this dashboard to: * Analyze traffic metrics for different applications and requests. * Identify usage trends and optimize application performance. Azure WebApps health dashboard ### Health The **Azure WebApps - Health** dashboard provides information of any service health incidents or resource health events associated with Azure WebApps in your azure account. Use this dashboard to: * View recent resource and service health incidents. * View distribution of service and resource health by incident type. Azure WebApps health dashboard ### Policy and Recommendations The **Azure WebApps - Policy and Recommendations** dashboard provides information of all effect action operations performed by Azure policy and recommendations events from Azure Advisor. Use this dashboard to: * Monitor policy events with warnings and errors. * View recent failed policy events. * View total recommendation events. * Identify High Impact recommendations. * View recent recommendation events and navigate to the affected resource. Azure WebApps - Policy and Recommendations dashboard ### Administrative Operations The **Azure WebApps - Administrative Operations** dashboard provides details on read/write/delete specific changes, different operations used, top 10 operations that caused most errors, and users performing admin operations. Use this dashboard to: * Identify top users performing administrative operations. * View Top 10 operations that caused the most errors. * View recent read, write, and delete operations. Azure WebApps Administrative Operations dashboard ### Instances The **Azure Web Apps - Instances** dashboard provides information of all effect action details performed based on Azure Web Apps Instances. Use this dashboard to: * View recent resource usage and performance based on Instances. * View distribution and service usage of resources by Instance. Azure Web Apps Instances dashboard ## Create monitors for Azure Web Apps app import CreateMonitors from '../../reuse/apps/create-monitors.md'; ### Azure Web Apps alerts These alerts are metrics-based and will work for all Web Apps. | Alert Name | Description | Alert Condition | Recover Condition | |:------------------------------------------|:-------------------------------------------------------------------------------------------|:----------------|:------------------| | `Azure Web Apps - Average Response Time` | This alert gets triggered when there is high response time detected in any Azure Function. | Count < 1 | Count >= 1 | | `Azure Web Apps - Delete function app` | This alert gets triggered when a function app is deleted. | Count >= 1 | Count < 1 | | `Azure Web Apps - Health Check Status` | This alert gets triggered when there is Health Check Status average drops less than 100. | Count < 100 | Count >= 100 | | `Azure Web Apps - Http 4xx Error` | This alert gets triggered when HTTP 4xx errors are high in the Azure Web Apps. | Count > 25 | Count =< 25 | | `Azure Web Apps - Https Server Error` | This alert gets triggered when HTTP 5xx errors are high in the Azure Web Apps. | Count > 25 | Count =< 25 | ## Upgrade/Downgrade the Azure Web Apps app (Optional) import AppUpdate from '../../reuse/apps/app-update.md'; ## Uninstalling the Azure Web Apps app (Optional) import AppUninstall from '../../reuse/apps/app-uninstall.md'; ## Troubleshooting ### Metrics collection via Azure Metrics Source To troubleshoot metrics collection via Azure Metrics Source, follow the instructions in [Troubleshooting Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source/#troubleshooting).