Use send notifications with Azure Logic Apps

Send notifications with Azure Logic Apps

In the following sample app, we notify users when products are updated. We use Azure Logic Apps to automate this process.

Azure Logic Apps handle automations that integrate systems, services, apps, and data. They move data around, send notifications, monitor data sources, and connect with other services through connectors.

Logic app capabilities include:

  • Sending email when an event occurs

  • Monitoring business reviews, analyzing review content, and sending notifications based on outcomes

  • Data cleansing pipelines and data migration

  • Integrating APIs and external systems

The following example is built from the chain that we started with our Azure Cosmos DB triggered Azure Function. The Azure Function sends data to Azure Event Hubs. Our logic app monitors Azure Event Hubs notifications and emails us when products are updated.

Create a logic app

  1. In the Azure portal, select Create a resource.

    Screenshot that shows the Azure portal Home page with Create a resource group highlighted.

  2. Search for logic app, and then select the Logic App.

    Screenshot that shows logic app search results on the Marketplace page.

  3. Select Create.

  4. On the Create Logic App page, enter the following settings:

    • Resource Group: pet-supplies-demo-rg
    • Logic App name: pet-supplies-wishlist-notice
    • Publish: Workflow
    • Region: <Choose your region>
    • Plan type: Consumption
  5. Select Review + create, then select Create.

Build the logic app

  1. After the logic app is created, navigate to the resource, which loads Logic App Designer. Select Blank Logic App.

    Screenshot that shows the Templates page with Blank Logic App selected.

  2. For the first task, search for event hub and then select the trigger When events are available in Event Hub.

    Screenshot that shows event hub search.

  3. Give your connection a name. For Connection String, set it to the value you used in AZURE_EVENT_HUB_CONNECTION. Then, select Create.

  4. After the step connects to the event hub, enter the following settings:

    • Event Hub name: pet-supplies-events
    • Content type: application/json
    • Consumer group name: $Default
  5. Add a new step.

  6. Search for Send an Email (V2) Outlook.

  7. Sign in with your Office 365 credentials.

  8. Enter your email address in the To list.

  9. For the subject, use Contoso Product Update.

  10. For the body, use: The following product is updated:.

  11. Add Content from the Dynamic content dialog.

  12. Select Save.

  13. As a test, make changes to Pet Supplies products and verify that events were added to the event hub.

  14. Select Run Trigger, then Run.

Learn more

Next | Scaling in Azure Cosmos DB