Forem

Cover image for Automate Email Alerts with Azure Logic Apps for New OneDrive Files
Oluwatobiloba Akinbobola
Oluwatobiloba Akinbobola

Posted on

Automate Email Alerts with Azure Logic Apps for New OneDrive Files

INTRODUCTION

Azure Logic Apps is a powerful cloud service that enables you to automate workflows and integrate services without writing extensive code. In this guide, we will create a Logic App that monitors a specific OneDrive folder and sends an email whenever a new file is added.

Prerequisites

Before proceeding, ensure you have the following:

  • An Azure subscription (you can sign up for a free trial if needed).
  • A OneDrive account.
  • An email account (such as Outlook, Gmail, or Office 365 Mail) to send notifications.

Steps to Create the Logic App

Step 1: Create an Azure Logic App
1.Sign in to Azure Portal: Go to Azure Portal and log in.
2.Create a new Logic App:
Logic Apps

  • In the Azure Portal, search for “Logic Apps” and select it. Logic Apps select
  • Click Create and provide the following details: Create
  • Click Review + Create and then Create. Review + Create create description

Step 2: Configure the Trigger

  1. Open the Logic App Designer:
    • In the Azure Portal, navigate to your newly created Logic App. Logic App
    • Click Logic App Designer > Blank Logic App.
  2. Add a OneDrive Trigger: OneDrive Trigger
    • Click on "When a file is created" (OneDrive trigger). When a file is created
    • Sign in with your OneDrive account to grant permissions. file is created
    • Configure the trigger settings:
      • Folder: Select the OneDrive folder to monitor.
      • Interval: Choose how often Azure checks for new files (e.g., every 1 minute). Configure trigger

Step 3: Add an Email Action

  1. Click + New Step and search for "Send an email".
  2. Select an email provider (Outlook, Gmail, or Office 365 Outlook). email provider
  3. Sign in and grant necessary permissions. Sign in email
  4. Configure the email action:
    • To: Enter the recipient’s email address.
    • Subject: Example - “New File Added: @{triggerOutputs()?['body/name']}”
    • Body: Example - "A new file named @{triggerOutputs()?['body/name']} has been added to OneDrive." Mail trigger

Step 4: Save and Enable the Logic App

  1. Click Save.
  2. Click Run Trigger to test the setup.
  3. Upload a new file to the specified OneDrive folder.
  4. Check your email to confirm the notification.

CONCLUSION

By following these steps, you have successfully created an Azure Logic App that sends an email when a new file is added to a OneDrive folder. This automation can be useful for monitoring file uploads, document management, and real-time notifications.

Top comments (0)