Advertisement
Поиск  
Always will be ready notify the world about expectations as easy as possible: job change page
Feb 15

How to configure Application Insights with Azure?

Автор:
Источник:
Просмотров:
994

Scenario: You are the web administrator for User Illusions, a virtual reality gaming company based in Hollywood, CA. You must ensure that your company website is up and running at all times. If an outage is detected, you must be notified so that you can take action quickly.

You will need to:

  • Enable Application Insights on an Azure web app
  • Create a URL ping test in Application Insights
  • Configure an action group to notify you (via email) of an outage

Pre-requisites:

  • For the above scenario
  • App Service plan is enabled.
  • Web-app is already created.
  • Log-Analytics workspace is already created.

Configure Application Insights with Azure

Introduction

Application Insights can assist you in determining the availability and performance of your web applications. In this demonstration, you deploy Application Insights into the Azure environment and use it to run a URL ping test against the sample web app.

Solution

Log in to the Azure portal.

The Existence of Azure Resources (Pre-requisites)

Click on All Resources in the navigation menu to view the provisioned resources.

Survey the resources already provisioned in the resource group overview page: an App Service plan, a web app, and a Log Analytics workspace.

Click webappyou created for the App Service resource.

Create App Service resource

In the upper left corner, right-click Browse, copy the link for the URL to your clipboard, and save it in a text file for later.

Web app properties

Click Browse to preview the website.

Configure Application Insights for the Azure Web App

In the left navigation menu, under Settings, click Application Insights.

Configure Application Insights

Click Turn on Application Insights.

Turn on Application Insights

Under Log Analytics Workspace, click on the dropdown menu and select the existing Log Analytics workspace; it will correspond with the name of the Azure web app (i.e., not the new one).

Log Analytics Workspace

Under Instrument your application, select .NET.

Under Collection level, choose Basic.

Click Apply; then, click Yes.

Create and configure the URL ping test

Once it’s deployed, in the upper left breadcrumb trail, click on the resource group.

In the top toolbar, click on the Refresh icon; you should see the new Application Insights instance.

Web app

Click on that new Application Insights instance.

In the left navigation menu, under Investigate, click Availability.

Application Insights instance availability

In the top toolbar, click + Add Classic test.

In the right Create test pane, Enter URLTest1 for the Test name.

Ensure the SKU is URL ping.

Under URL, paste in the URL you copied from webapp.

Click Create.

Create Availability Test

Once it’s created, you should see it under Availability Test.

Click the ‘…’ at the end of the URLTest1 row.

Select Open Rules (Alerts) page.

Create Action Group

  1. In the Rules pane, click the link to open the rule.
  2. In the upper right corner, click Edit.
  3. Scroll down and, under Actions, click Select action groups.
  4. In the right Select action groups pane, click + Create action group.
  5. In the Basics tab, under Instance details > Action group name, enter ActionGroup1.
  6. Click Next: Notifications.
  7. Under Notification type, click on the dropdown menu and select Email/SMS message/Push/Voice.
  8. For the Name, enter EmailMe.
  9. On the right-hand pane, click the checkbox next to Email to select it.
  10. Enter your email address in the Email field.
  11. Click OK.
  12. Click Review + create.
  13. Click Create.
  14. Check your email account to verify you’ve received a notification about being added to the action group.
  15. Click Save in the upper left corner.
  16. In the upper left breadcrumb trail, click on the Azure Insights instance.
  17. In the top toolbar, click on the Refresh icon.
  18. Under Availability Test, click on URLTest1 to expand the ping test; you should see 100% availability.

Availability Test

Cause an App Service failure

In the upper left breadcrumb trail, click on the resource group.

Click the link for the App Service resource.

In the top toolbar, click Stop.

On the Stop web app pop-up, click Yes.

Navigate back to the browser tab previewing the website, and refresh the page; you should see Error 403.

Web app is stopped

Back in the Azure portal, in the upper left breadcrumb trail, click on the resource group.

Click the link for the Application Insights resource.

In the left navigation menu, under Investigate, click Availability.

Under Availability Test, click on URLTest1 to expand the ping test.

In the top toolbar, click on the Refresh icon until multiple locations indicate an error. This may take up to five minutes.

Availability Test investigation

Wait for Alert Email

Check your email and refresh your mailbox until you receive the alert email regarding the availability test failure.

Conclusion

Congratulations — you’ve completed configuring Application Insights in Azure.

Похожее
Dec 21, 2023
Author: Roman Glushach
Domain-Driven Design (DDD)Domain-driven design (DDD) is a software design approach that focuses on modeling the software to match the domain, or the subject area, that the software is intended for. DDD helps developers create software that is aligned with the...
Jan 1, 2023
Author: Daniel Kreider
Here’s the simple step-by-step guide that will teach you how to build and code a generic repository.There are oodles of design patterns.Some of these design patterns are floating about on antique blogs full of mad logic. They’re ridiculous enough to...
Feb 5
Author: Crafting-Code
Lesser-known techniques for optimizing SQL queries in a high-traffic application, especially when dealing with complex joins and indexing challengesThe success of high-traffic applications hinges on the efficient performance of their underlying databases. As the complexity of SQL queries grows, especially...
Feb 10, 2023
Author: Abdelmajid BACO
A Quick Guide to Transient, Scoped, and Singleton in C#.In C#, the Transient, Scoped, and Singleton scopes are options for controlling the lifetime of objects which are created by dependency injection.TransientTransient objects are created each time they are requested. This...
Написать сообщение
Почта
Имя
*Сообщение


© 1999–2024 WebDynamics
1980–... Sergey Drozdov
Area of interests: .NET Framework | .NET Core | C# | ASP.NET | Windows Forms | WPF | HTML5 | CSS3 | jQuery | AJAX | Angular | React | MS SQL Server | Transact-SQL | ADO.NET | Entity Framework | IIS | OOP | OOA | OOD | WCF | WPF | MSMQ | MVC | MVP | MVVM | Design Patterns | Enterprise Architecture | Scrum | Kanban