Create activity log alerts for labs in Azure DevTest Labs

This article explains how to create activity log alerts for labs in Azure DevTest Labs (for example: when a VM is created or when a VM is deleted).

Create alerts

In this example, you create an alert for all administrative operations on a lab with an action that sends an email to subscription owners.

  1. Sign in to the Azure portal.

  2. In the search bar of the Azure portal, type Monitor, and then select Monitor from the results list.

    Search for Monitor

  3. Select Alerts on the left menu, and then select New alert rule on the toolbar.

    Alerts page

  4. On the Create alert rule page, click Select resource.

    Select resource for the alert

  5. Select DevTest Labs for Filter by resource type, select your lab in the list, and then select Done.

    Select your lab as the resource

  6. Back on the Create alert rule page, click Select condition.

    Select condition link

  7. On the Configure signal logic page, select a signal supported by DevTest Labs.

    Select signal

  8. Filter by event level (Verbose, Informational, Warning, Error, Critical, All), status (Failed, Started, Succeeded), and who initiated the event.

  9. Select Done to complete configuring the condition.

    Configure signal logic - done

  10. You have specified for the scope (lab) and the condition for the alert. Now, you need to specify an action group with actions to be run when the condition is met. Back on the Create alert rule page, choose Select action group.

    Select action group link

  11. Select Create action group link on the toolbar.

    Create action group link

  12. On the Add action group page, follow these steps:

    1. Enter a name for the action group.

    2. Enter a short name for the action group.

    3. Select the resource group in which you want the alert to be created.

    4. Enter a name for the action.

    5. Select the action type (in this example, Email Azure Resource Manager Role).

      Add action group page

    6. On the Email Azure Resource Manager Role page, select the role. In this example, it's Owner. Then, select OK.

      Select role

    7. Select OK on the Add action group page.

  13. Now, on the Create alert rule page, enter a name for the alert rule, and then select OK.

    Create alert rule - done

View alerts

  1. You will see alerts on the Alerts for all administrative operations (in this example). Alerts may take sometime to show up.

    Screen capture displays alerts in the Dashboard.

  2. If you select number in a column (for example: Total alerts), you see the alerts that were raised.

    All alerts

  3. If you select an alert, you see details about it.

    Alert details

  4. In this example, you also receive an email with content as shown in the following example:

    Alert email

Next steps