Skip to main content

Configure Application Insights with Azure

Hands-On Lab

 

Photo of James Lee

James Lee

Training Architect

Length

01:15:00

Difficulty

Intermediate

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

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Configure Application Insights with Azure

Introduction

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

Connecting to the Lab

  1. Log in to the Azure Portal using the credentials provided on the lab instructions page.

Obtain the URL of the Azure Web App

  1. Click All resource on the left-hand menu.

  2. Click the link for the app service.

  3. Copy the URL to the clipboard. This will be used in a future step.

Configure Application Insights for the Azure Web App

  1. Click Application Insights under Settings.

  2. Click Turn on Application Insights.

  3. In the window that appears, scroll down to the Instrument your application section. Under Collection level, click Basic.

  4. Click Apply at the bottom of the window.

  5. Click Yes.

  6. Click All resources in the navigation pane.

  7. Verify the existence of the Application Insights resource.

Create and Run the URL Ping Test

  1. Click on the link for the Application Insights resource.

  2. Click Availability under Investigate.

  3. Click + Add test.

  4. Enter "URLPing1" in the box under Test name.

  5. Paste the copied URL from the first task into the box under URL.

  6. Click Create.

  7. Click the ... at the end of the URLPing1 row.

  8. Select Edit alert from the context menu.

  9. Click the Create action group button.

  1. Enter "Agroup1" in the Action group name box.

  2. Enter "Agroup1" in the Short name box.

  3. Click the combo box for the Resource group and select the resource group associated with the lab.

  4. Enter "Emailme" in the box under Action Name.

  5. Click the combo box under Action type and select Email/SMS/Push/Voice.

  6. In the pop-up window, select the Email checkbox.

  7. Enter your email address in the Email field.

  8. Click OK.

  9. Click OK on the Add action group window.

  10. Click Save.

  11. Check your email account to verify you've received a notification about being added to the action group.

Stop the Web App

  1. Back in the Portal, close the Rules management window.

  2. In the Application Insights window, click Refresh.

  3. Click the Local Time button at the top of the window.

  4. Select Last 30 minutes.

  5. Click Apply.

  6. Click All resources in the navigation pane.

  7. Click the link for the app service.

  8. Click Stop in the ribbon at the top of the window.

  9. Click Yes.

  1. Click All resources at the top of the window.

  2. Click the link for the Application Insights resource.

  3. Click Availability under Investigate.

  4. Refresh using the Refresh button in the ribbon until multiple locations indicate an error. This may take up to five minutes.

Wait for Alert Email

  1. Check your email and refresh the mailbox until you receive the alert email.

Conclusion

Congratulations, you've completed this hands-on lab!