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:
- In the Azure Portal, search for “Logic Apps” and select it.
- Click Create and provide the following details:
- Click Review + Create and then Create.
Step 2: Configure the Trigger
-
Open the Logic App Designer:
- In the Azure Portal, navigate to your newly created Logic App.
- Click Logic App Designer > Blank Logic App.
- In the Azure Portal, navigate to your newly created Logic App.
-
Add a OneDrive Trigger:
- Click on "When a file is created" (OneDrive trigger).
- Sign in with your OneDrive account to grant permissions.
- 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).
- Click on "When a file is created" (OneDrive trigger).
Step 3: Add an Email Action
- Click + New Step and search for "Send an email".
- Select an email provider (Outlook, Gmail, or Office 365 Outlook).
- Sign in and grant necessary permissions.
- 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."
Step 4: Save and Enable the Logic App
- Click Save.
- Click Run Trigger to test the setup.
- Upload a new file to the specified OneDrive folder.
- 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)