Introduction
This project focuses on creating a Logic App that sends an email message automatically on Microsoft Azure. Logic Apps are serverless workflows that make it easy to automate tasks without managing servers.
Why Is It Useful?
Automation: Automatically trigger emails in response to events or at scheduled times.
Scalability: No infrastructure management; pay only for what you use (or free within certain limits).
Integration: Easily connect different services (Office 365, Gmail, or third-party APIs).
Prerequisites
Step-by-Step Implementation
Below are the steps to create and deploy your Logic App. Each step combines console (GUI) and terminal (CLI) instructions so you can follow whichever method you prefer—or learn both.
Create a Resource Group
A Resource Group is a container in Azure that holds related resources.
In the Console (GUI)
Go to the Azure Portal.
On the left menu, select Resource groups.
Click + Create.
Subscription: Choose your free-tier subscription.
Resource group: For example, MyLogicAppRG.
Region: Pick a region close to you, e.g. East US.
Click Review + create, then Create.
Resource Group details.
In the Terminal (CLI)
Explanation:
Create a Logic App (Consumption) Resource
In the Console (GUI)
In the Azure Portal, click Create a resource (top left).
Search for Logic App.
Select Logic App (Consumption) and click Create.
Basics tab:
Subscription: Your free-tier subscription.
Resource group: Pick MyLogicAppRG.
Name: For example, SendEmailLogicApp.
Region: East US (should match the resource group region ideally).
Plan type: Ensure it’s set to Consumption (pay per execution; free if usage is minimal).
Review + Create → Create.
In the Terminal (CLI)
Logic Apps can be created with the az resource command or via an ARM template. Below is a simplified approach using the az resource create command:
Explanation:
Define the Logic App Workflow (Trigger and Action)
We’ll set up a trigger (for example, an HTTP trigger or a Recurrence trigger) that prompts the Logic App to send an email. We’ll also configure the Send email action.
In the Console (GUI)
Go to Resource groups → open MyLogicAppRG.
Click on SendEmailLogicApp to open it.
On the Logic App page, click Logic App Designer (or Workflow in some interfaces).
Choose a trigger:
If you want a time-based trigger, click Recurrence and set it to run every X minutes/hours/days.
Or, if you prefer a manual trigger for testing, select When an HTTP request is received.
After selecting the trigger and configuring it, click + New step below it.
Search for Outlook or Gmail or your preferred email connector, e.g. “Office 365 Outlook — Send an email (V2).”
Sign in to your email account if prompted, allowing the Logic App to send emails.
In the Send an email action fields:
To: Your test email address or a distribution list.
Subject: e.g. “Hello from Azure Logic Apps!”
Body: Custom message.
Click Save at the top.
In the Terminal (CLI)
# 1) Create a simple JSON definition for your Logic App workflow:
cat <<EOF > logicapp-workflow.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Logic/workflows",
"apiVersion": "2019-05-01",
"name": "SendEmailLogicApp",
"location": "eastus",
"properties": {
"state": "Enabled",
"definition": {
"triggers": {
"EveryDayTrigger": {
"type": "Recurrence",
"recurrence": {
"frequency": "Day",
"interval": 1
}
}
},
"actions": {
"SendEmail": {
"type": "ApiConnection",
"inputs": {
"host": {
"apiId": "/subscriptions/<subscription_id>/providers/Microsoft.Web/locations/eastus/managedApis/office365"
},
"method": "post",
"path": "/sendmail",
"body": {
"subject": "Hello from Azure Logic Apps!",
"body": "This is a test email.",
"to": [
"your_email@example.com"
]
}
},
"runAfter": {}
}
},
"contentVersion": "1.0.0.0"
}
}
}
]
}
EOF
# 2) Deploy this template to Azure
Explanation:
Verifying and Testing the Project
Common Issues and Troubleshooting
Conclusion
We have successfully created an Azure Logic App that sends an email using a serverless approach. You learned:
How to create a Resource Group and a Logic App via GUI and CLI.
How to define a trigger (recurrence or HTTP) and configure the send email action.
How to verify and test runs in the Azure Portal.
This project requires no up-front credit if you use the Azure Free Tier and keep usage minimal.
Popular Projects
What is Cloud Computing ?
Cloud computing delivers computing resources (servers, storage, databases, networking, and software) over the internet, allowing businesses to scale and pay only for what they use, eliminating the need for physical infrastructure.