In this article, we will take a detailed look at the end-to-end scenario of setting up monitoring of an API app with a real time scenario.


Scenario 1 - Monitoring an API App without Endpoint Responses

Lets say we have an API app that is up and running in the Azure Portal. The API app has multiple URL endpoints associated. You can set up monitoring only on the API app and get updates from BizTalk360 when the API app is in a different state (disabled). Follow the steps as shown below to monitor the health of the API app.

  1. Log into the BizTalk360 application
  2. Create a New Alarm. Select For Threshold Monitoring from the drop down.

    alarms for monitoring api app without endpoint responses

  3. Enter the Alarm Name as "Monitor API app", enter the email id's to which you want to send the notifications in case of any threshold violation (say, scott@acme.com), a description for the alarm. Click Next.

    threshold alarm for api apps in biztalk360


  4. Toggle the Alert on Threshold Violation icon to set the threshold violation. Set the threshold violation persist duration to 10 minutes. Select the "Limit number of alerts per violation to" checkbox to 3. Select the "Notify when things become normal after violation" checkbox to receive an email notification when things become normal after the violation is resolved. Click OK to set up the alarm.

    threshold violation alert in biztalk360 for api apps

  5. Click 'Monitoring' in the navigation panel. Click the + button against 'Manage Mapping' tab and select 'Azure Services'. Select the Alarm name (Monitor API app) from the drop down.
  6. Choose the Azure subscription from the drop down
    If there are no Azure subscriptions mapped to your environment, you will see a warning message as "No Azure Subscriptions Found/Enabled". Click "Go to Settings to Add/Enable". Refer this article to know the details of adding a new Azure subscription.
  7. Select the API Apps tab. This will list the API Apps that are created under the selected subscription.

    monitoring azure services for biztalk server in biztalk360


  8. Let's say, we want to monitor the BT360ApiAppsDemo API app from the list of available API Apps
  9. Select the check box against the BT360ApiAppsDemo API app. From the Expected State drop down, choose the expected state of the API app in order to set up monitoring. Let's say, we expect the API app to be Enabled at all time.
     alarms monitoring status for api apps in biztalk360

  10. Setting the expected state will automatically start monitoring the API app. BizTalk360 monitoring service will automatically compare the current state of the API app with the expected state and display the status (as Healthy or Error). If there expected state matches with the current state, you will notice the status of the API app as Healthy (in green color). If there is a state mismatch, the status of the API app will be displayed as Error (in red color). azure api apps health check in biztalk360

  11. In order to receive email notifications from BizTalk360 on the threshold violation alerts (and auto correction alerts), you need to configure the SMTP settings under BizTalk360 Settings. Follow the steps in this article to be able to configure the SMTP settings in BizTalk360. You will receive an email notification with the exact details of the status of the API app.
    azure services status summary in biztalk360

  12. The monitoring dashboard will reflect the health of the Azure services as shown in the image below. monitoring dashboard full view in biztalk360 


Scenario 2 - Monitoring an API App with Endpoint Responses

For this scenario, lets monitor the API based on the return code and response time alerts. If the API endpoint is in a healthy state, the URL will return a 200 return code. If we do not get the 200 return code, the status of the monitoring will be displayed as Error. Let's set a warning alert if we do not receive the response from the endpoint in 2 seconds and an error alert if we do not receive the response from the endpoint in 7 seconds.


For the above scenario, lets assume the following results vs. the actual values -

Return Code Setting Returned Value Set Value
Return Code Alerts 200 200
Response Time Alerts < 2 seconds (Default values)


Follow the steps as shown below to monitor the API app URL endpoints. 

  1. Log into the BizTalk360 application
  2. Create a New Alarm. Select For Threshold Monitoring from the drop down.

    threshold monitoring alarm in biztalk360 application

  3. Enter the Alarm Name as "Monitor API app", enter the email id's to which you want to send the notifications in case of any threshold violation (say, scott@acme.com), a description for the alarm. Click Next.

    monitoring azure api apps in biztalk environment


  4. Toggle the Alert on Threshold Violation icon to set the threshold violation. Set the threshold violation persist duration to 10 minutes. Select the "Limit number of alerts per violation to" checkbox to 3. Select the "Notify when things become normal after violation" checkbox to receive an email notification when things become normal after the violation is resolved. Click OK to set up the alarm.

    threshold violation alert for alarms in biztalk360

  5. Click 'Monitoring' in the navigation panel. Click the + button against 'Manage Mapping' tab and select 'Azure Services'. Select the Alarm name (Monitor API app) from the drop down.
  6. Choose the Azure subscription from the drop down
    If there are no Azure subscriptions mapped to your environment, you will see a warning message as "No Azure Subscriptions Found/Enabled". Click "Go to Settings to Add/Enable". Refer this article to know the details of adding a new Azure subscription.
  7. Select the API Apps tab. This will list the API Apps that are created under the selected subscription.

    monitoring azure api apps alarm status


  8. Let's say, we want to monitor the BT360ApiAppsDemo API app from the list of available API Apps
  9. Select the check box against the corresponding API of the BT360ApiAppsDemo API app, say, /api/Dev/{id}. Click the Configure API App Endpoints button. This will open a new blade.

    configure api apps endpoints alarm in biztalk360


  10. The Friendly Name and Endpoint URL fields will automatically be pre-populated with the information about the API. Enable Monitoring (by toggling the Enable Monitoring toggle bar) for the API app web endpoint.

    enable monitoring for api web endpoint


  11. Click Next to navigate to the next section. In the Configuring API App Endpoints - Optional Details blade, since the API requires a payload input (for the "id" field), let's define the payload information in the Payload section. Enter the key as id and value as 1. This means that were are executing the API to retrieve (GET) the first record from the list of values.

    payload details for web service endpoint monitoring



  12. Click Next to navigate to the Response alert configuration screen 
  13. Choose the response format as JSON. Toggle the Return Code Alerts to active state. Set the return status code to 200, expected status to must be Present, and Else to throw Error.
  14. The Response Time Alerts will be enabled by default. You can leave it to the default values of 2 seconds (warning) and 7 seconds (error) respectively, or you can modify the values based on your requirement. As per our scenario (since it matches the default setting), let's leave it in the default setting.

    json response format for web service monitoring alert configuration


  15. Click OK to start monitoring the endpoint

    setting up an alarm to monitor azure services in biztalk360

    endpoint summary for return code alerts and response time alerts in biztalk360


  16. The monitoring dashboard will reflect the health of the Azure services as shown in the image below. biztalk360 alarms monitoring dashboard full view


In this case, the Current Status of the web endpoint will be displayed as Healthy. This is because the return code value matches the set value and the response time was well within the warning and error level. The endpoint summary will display the state as Healthy for both Return Code Alerts and Response Time Alerts.