Serverless Integration: Automate Your Workflow with Logic App

Celestina Odili - Sep 18 - - Dev Community

Here is a step-by-step guide to creating a Logic App and automating a task process in the Azure portal:

Step 1: Log in to Azure Portal

Step 2: Create a Logic App

  • In the search bar at the top of the Azure Portal, type "Logic Apps" and select Logic Apps from the search results.
  • Click on + Add

Image description

  • Select a hosting option to begin creating a new Logic App. Choose between Consumption Plan and Standard Plans.
  • click select

Image description

Step 3: Configure the Logic App

  • Basics Settings:
    • Subscription: Select your Azure subscription.
    • Resource Group: Choose an existing resource group or create a new one by clicking Create new.
    • Logic App Name: Enter a globally unique name for your Logic App.
    • Region: Select the Azure region where the Logic App will be hosted. Choose a location closest to your users.
    • Enable Log Analytics: select yes or No

Image description

  • Review and Create:
    • Click Review + Create.
    • Review all the information entered.
    • Click Create to deploy the Logic App.

Step 4: Define a Workflow

  • Go to the Logic App Designer:
    • After deployment, click Go to Resource to open your Logic App.
    • In the left pane, select Development Tools
    • Select Logic App Designer.
    • Click add a trigger

Image description

  • Choose a Workflow Trigger:
    • Choose a Trigger for your workflow. Triggers tell your app when to start running. Each workflow needs at least one trigger. It can be event-based or schedule-based.
      • Examples of Triggers:
      • HTTP Request (e.g., when an HTTP request is received).
      • Recurrence (e.g., run every 1 hour).
      • Azure Service (e.g., when a new blob is added to Azure Storage).
      • OneDrive (e.g, when a file is created)
      • Gmail (e.g, when a new email arrives)

we will be using OneDrive (When a file is created) trigger here.

Image description

  • Create a connection by signing in
  • Click accept to allow logic app access to your information

On the parameter tab:

  • add the particular folder you want to track, choose root if there is none in particular.
  • choose how often the folder will be checked.
  • click save

Image description

  • Add Actions to the Workflow:

    • After defining the trigger, click New Step to add Actions.

Image description

Actions are tasks that run when the trigger condition is met. You can integrate various services (e.g., send an email, create a record in a database, call an API, etc.).
- Examples of Actions:
- Send an email using Office 365.
- Insert data into SQL Server.
- Send email Gmail
In this article, we will use send email (Gmail)

Image description

  • Provides a connection name and authentication type and sign in to create a connection.

Image description

  • Select the email to be used, sign in, allow access and continue.

Image description

  • On the action parameter tab, add your recipient email address, compose the automatic email and save.

Image description

Image description

Step 5: Test the Logic App

  • After configuring the trigger and actions, click Save in the top toolbar to save your Logic App. The Logic App will check for the stated trigger following the time interval configured and execute the action once the parameter is met. Now let us test the logic app.

  • Upload a new file in OneDrive.

Image description

  • After the configured time interval, check the recipient email.

Image description

  • To test the Logic App manually, click on Run Trigger in the Logic App overview.
  • You can also monitor the workflow execution in real-time by going to the Run History tab on the Development Tools, which shows the status of each run (successful or failed).

Image description

Step 6: Clean up

When you are done testing your logic app, delete the resource group to avoid incurring charges. This will clean up the resource group and all resources in it.

. . . . . . . . . . . . .
Terabox Video Player