Lab 2: Configure Azure logic app to monitor changes to a resource group.

The main tasks for this exercise are as follows:

  1. Add a trigger to the Azure logic app

  2. Add an action to the Azure logic app

  3. Identify the callback URL of the Azure logic app

  4. Configure an event subscription

  5. Test the logic app

Task 1: Add a trigger to the Azure logic app

  1. In the the Azure portal, navigate to the Logic App Designer blade of the newly provisioned Azure logic app.

  2. Click Blank Logic App. This will create a blank designer workspace and display a list of connectors and triggers to add to the workspace.

  3. Search for Event Grid triggers and, in the list of results, click the When a resource event occurs Azure Event Grid trigger to add it to the designer workspace.

  4. In the Azure Event Grid tile, click the Connect with Service Principal link, specify the following values, and click Create:

    • Connection Name: egc30007

    • Client ID: the ApplicationId property you identified in the previous exercise

    • Client Secret: Pa55w.rd1234

    • Tenant: the TenantId property you identified in the previous exercise

  5. In the When a resource event occurs tile, specify the following values:

    • Subscription: the subscription Id property you identified in the previous exercise

    • Resource Type: Microsoft.Resources.resourceGroups

    • Resource Name: az3000701-LabRG

    • Event Type Item - 1: Microsoft.Resources.ResourceWriteSuccess

    • Event Type Item - 2: Microsoft.Resources.ResourceDeleteSuccess

  6. Click Add new parameter and select Subscription Name

  7. In the Subscription Name text box, type event-subscription-az3000701 and click Save.

Task 2: Add an action to the Azure logic app

  1. In the the Azure portal, on the Logic App Designer blade of the newly provisioned Azure logic app, click + New step.

  2. In the Choose an action pane, in the Search connectors and actions text box, type Outlook.

  3. In the list of results, click Outlook.com.

  4. In the list of actions for Outlook.com, click Send an email.

  5. In the Outlook.com pane, click Sign in.

  6. When prompted, authenticate by using the Microsoft Account you are using in this lab.

  7. When prompted for the consent to grant Azure Logic App permissions to access Outlook resources, click Yes.

  8. In the Send an email pane, specify the following settings and click Save:

    • To: the primary e-mail address of your Microsoft Account

    • Subject: type Resource updated: and, in the Dynamic Content column to the right of the Send an email pane, click Subject.

    • Body: type Resource group:, in the Dynamic Content column to the right of the Send an email pane, click Topic, type Event type:, in the Dynamic Content column to the right of the Send an email pane, click Event Type, type Event ID:, in the Dynamic Content column to the right of the Send an email pane, click ID, type Event Time:, and in the Dynamic Content column to the right of the Send an email pane, click Event Time.

Task 3: Identify the callback URL of the Azure logic app

  1. In the Azure portal, navigate to the logicapp3000701 blade and, in the Summary section, click See trigger history. Ignore any Forbidden error messages.

  2. On the When_a_resource_event_occurs blade, copy the value of the Callback url [POST] text box.

Task 4: Configure an event subscription

  1. In the Azure portal, navigate to the az3000701-LabRG resource group and, in the vertical menu, click Events.

  2. On the az3000701-LabRG - Events blade, select Get Started and click Web Hook.

  3. On the Create Event Subscription blade, in the Filter to Event Types drop down list, ensure that only the checkboxes next to the Resource Write Success and Resource Delete Success are selected.

  4. In the Endpoint Type drop down list, ensure that Web Hook is selected and click the Select an endpoint link.

  5. On the Select Web Hook blade, in the Subscriber Endpoint, paste the value of the Callback url [POST] of the Azure logic app you copied in the previous task and click Confirm Selection.

  6. In the Name text box within the EVENT SUBSCRIPTION DETAILS section, type event-subscription-az3000701.

  7. Click Create.

Task 5: Test the logic app

  1. In the Azure portal, navigate to the az3000701-LabRG resource group and, in the vertical menu, click Overview.

  2. In the list of resources, click the Azure storage account you created in the first exercise.

  3. On the storage account blade, in the vertical menu, click Configuration.

  4. On the configuration blade, set the Secure transfer required setting to Disabled and click Save

  5. Navigate to the logicapp3000701 blade, click Refresh, and note that the Runs history includes the entry corresponding to configuration change of the Azure storage account.

  6. Navigate to the inbox of the email account you configured in this exercise and verify that includes an email generated by the logic app.

Review

After you completed this exercise, you have configured an Azure logic app to monitor changes to a resource group.

results matching ""

    No results matching ""