none
Monitoring App Services RRS feed

  • Question

  • Hi , I have more than 120 App Services in my subscription belonging to different resource groups.

    1. Whenever any app service get down , i will be informed by email. I dont want to put this email alert on each app service means i will do this on 120 app services. Its the requirement.

    2.I want to check average response time on each service on single portal/dashboard. I dont want to create each dashboard for each service.

    3. I also want to see interesting data like , abnormal behavior , sudden change in size/data, predictions etc .....

    4. I want to see these stats on hourly basis and 04/08/12/24 hours periodic intervals.

    Thank You!!!


    WSBukhari

    Sunday, December 30, 2018 3:50 PM

All replies

  • I want to make sure that we clearly understand what your requirements are:

    • You have 120 app services
    • You may not want to enable email alerts on all app services
    • You want a single dashboard for all 120 app services
    • You want custom information about irregularities
    • You want to see hourly, and periodic data every 4 hours
    Tuesday, January 1, 2019 1:46 AM
    Moderator
  • EXACTLY. Thanks

    WSBukhari

    Tuesday, January 1, 2019 9:22 PM
  • Looking forward to hearing from you. Regards

    WSBukhari

    Thursday, January 3, 2019 11:36 AM
  • Hi,

    1. You can explore the following possible options, if you want to do it for all the 120 App Services.

    -      First part of the activity is to collect the Data when a specific App Service is down.

    • Using Azure Activity logs in Log Analytics
      • As a pre-requisite, you need to ensure that a Log Analytics workspace is created and Azure Activity Logs of the Subscription are connected.  Additional documentation reference: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/collect-activity-logs
      • If all your app services are in one resource group, you can use the following query in Log Analytics to capture any App Service that is down within that specific resource group. You can always modify the query to add other resource groups if your app services are hosted across multiple resource groups.  
        • AzureActivity | where ResourceProvider == "Azure Web Sites" and ResourceGroup == "Your Resource Group Name" and OperationNameValue == "Microsoft.Web/sites/stop/action" and ActivityStatus == "Succeeded"

    • Using Availability Tests for all the app services
      • As a pre-requisite for this you need to ensure of creating Availability tests for all of your 120 app services (one time manual activity for existing and every other new app service you are adding as well, as Availability tests are usually configured on a per resource basis for Application Insights, and there is no means of doing this for multiple resources at once in bulk). You can choose this option if you don’t want to create a new Log Analytics workspace and use the existing application insights instance. Additional documentation reference for creating Availability Tests: https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-web-app-availability(However, you might want to explore the programmatic way of doing this with a script that can fetch all the App service resources in the specified resource groups and creating alerts through Azure CLI or other means.)
      • Assuming all of your App Services have Availability Tests configured and sending data to Application Insights, you can use the following query:
        • availabilityResults | where success == "0" (or)
        • availabilityResults | where message != "Passed"

          - Once you have the data, you can create a “New Alert Rule” both from Log Analytics or Application Insights and configure the Action Group and Alert details with email as per your requirement. Additional documentation for your reference: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-tutorial-alert

    2. The following are the available options:

    • Average Response Time of a resource can be checked under the Overview blade of the selected App Service. Within “Metrics” Blade of the App Service, you can “Add Metric” with filters to Resource, Metric Namespace (App Service standard Metrics) and Metric (Average Response Time). Understand that it is a manual activity to add filters for all your App Services. Time range and Time Granularity can also be adjusted for the same. Once you have all the necessary resources added, you can click on the "Pin to Dashboard" button to have the graph displayed on the desired dashboard. This would look something like the following picture.


    • If you are sending the data of all App Services to Application Insights you can use the below sample query and pin it to the dashboard.
      • requests| summarize avg(duration) by url, bin(timestamp, 1h)
        | render  timechart

    Note: Adding tens and hundreds of sources to the same graph can make it look less readable. Also, be aware that Azure dashboards have a JSON representation, and can be downloaded/uploaded appropriately to avoid manual effort. Reference documentation: https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically

    3. For viewing such information, you can leverage the Smart Detection capability provided by Azure Application Insights. Here is the detailed doc for your reference: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-diagnostics

    4. There are various options provided for setting the Time range and Granularity in the Metric graphs. Attached is the screenshot for the same.


    For metrics related graphs from App Services, you can set the interval to 1 hr. And for any queries for Log Analytics/Application Insights you can set the bin(timestamp)to 1hr. For periodic interval data of every 4Hr, you can possibly use bin(timestamp, 4h). However, you cannot use 4hr, 8hr, 12Hr on the same query and get a single graph.

    You may explore the pricing options for Azure Monitor here: https://azure.microsoft.com/en-us/pricing/details/monitor/ and https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/app-service-web-app/app-monitoring#pricing and choose your options accordingly.

    Hope this helps!






    Friday, January 4, 2019 10:43 AM
    Moderator
  • AzureActivity | where ResourceProvider == "Azure Web Sites" and ResourceGroup == "Your Resource Group Name" and OperationName == "Microsoft.Web/sites/stop/action" and ActivityStatus == "Succeeded"

    above query is not showing up right result.

    I have get my app services down of one resource group and run this query , No results.


    WSBukhari

    Wednesday, January 9, 2019 11:45 AM
  • Apologies for the inconvenience.

    Please try the following instead:

    AzureActivity | where ResourceProvider == "Azure Web Sites" and ResourceGroup == "Your Resource Group Name" and OperationNameValue == "Microsoft.Web/sites/stop/action" and ActivityStatus == "Succeeded"

    Please revert in case of issues.


    Friday, January 11, 2019 10:26 AM
    Moderator
  • Hello IbrahimUmar,

    Have you had a chance to check if any of the above options worked for you? Please let us know otherwise and we'll be happy to assist you!

    Monday, January 14, 2019 7:23 AM
    Moderator
  • Hello IbrahimUmar,

    Have you had a chance to check if any of the above options worked for you? Please let us know otherwise and we'll be happy to assist you!



    Thursday, January 17, 2019 4:17 PM
    Moderator