Configuring Ping URL Tests/Health Checks with Azure Monitor Application Insights
Published: 2024-06-16 18:00:21

**What is Azure Monitor Application Insight**
As a deep dive, Application Insights serves as your application's health guardian. It offers insights into how your applications are performing and being utilized. Gain valuable data on performance metrics, user engagement, and retention.

Application Insight also tracks essential details like request and failure rates, response times, popular pages, and user demographics. With features like an application dependency map and performance insights, Application Insights equips you with the tools to master your application's well-being and performance.
**Availability Alerts**
Application Insights availability sends web requests to your application at regular intervals from points around the world. You can receive alerts if your application isn't responding or if it responds too slowly.

For this demo, we focused on availability. We're3 going to configure a URL ping test to check our availability and this will send an HTTP request to our Web App URL to see if there's a response. and then we're going to configure an alert based on the results of that test. Lets get started!
STEPS
1. Create web app using the app service on the azure portal
copy the url is similar to  htpps:solowebapp.azurewebsites.net

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnozp4ulwhd7cfrp8g8t.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zfchhomf6upxzvyvpc1p.png)
2.Go to azure portal search for azure monitor

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2l0zv6kxysf9dnw3k31f.png)
3.click application under insight 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp2sw2hui92oy19j9gvu.png)

4.click create

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8e1vsc3gbvxwerh6ez0.png)
5 fill the reaquired information and and click go to resource

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yvenzvmfrizderuop3u.png)
6 locate Availability under investigate.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oydmgvycqgeam9rzyzfp.png)
7 click add classic test

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghvnqfip0vtximsn134k.png)
8. fill the required classic test information such as
   name=as desired
   sku=ping
   url= https//:(url for the web app)
   test frequency: 5min
    Test location; select our desired location
    Success criteria: Htpp response
    Time out: 120 min
    Status code: 200
    Alert Status: enabled
     Click create.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qdue8hqoxhv98za7k81.png)
9.Click refresh to see your location.

HOW TO CONFIGURE ALERT 
a.Click on the elispes>>**...**<<

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31kzbtt2ezkqdbk74pey.png)
b. click open rules

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dds3m0mtfwbed42xc0m.png)
c. Locate alert rule configuration and select action group
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aa38dy3fri2xflg4cg77.png)
d. Select create action group

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejdheuqajuzy1h4z30c2.png)
e. Fill the required  intance details
     action group name :
     Display name:
 Click next to notification

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k54lcme49ku5cdqv7vy5.png) 

f.Select notification type
   Select email/sms/push/voice
   Name: Use desired name
   
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcresjotnl6gc315qw7q.png)
g. Click review and create

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggtnajjzo8rhpwof1n8j.png)

h. Click create
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t4xgp0wbut2u2sxhmd2.png)

**HOW TO STOP MONITORING A WEB APP**
k. open your web app in azure app service

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqy93fgzmo3l8zeihiek.png)
 
m.Click Stop

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pdk9cdbkoo39xe89q65l.png)
n. Go Back to your azure home page,search for monitor, navigate to availability.Check for errors in the didplayed info.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzels1mrbzjfh3p9wel1.png)

n. Similarly when you input your url to google. It will also display error 403.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0mqi2bf7mpugdvq1yax.png)