Build a Simple Azure Logic App

Learn to build a simple Azure Logic App in this hands-on Azure tutorial. Step-by-step guidance on core concepts, practical exercises, and troubleshooting tips.

Focus: build a simple azure logic app

Sponsored

Imagine you’ve just been asked to automate a repetitive workflow — maybe copying new files from a storage account to a database, or sending a Slack message whenever a support ticket is created. You could write a full application, deploy it, manage its uptime, and handle retries. Or you could build a simple Azure Logic App in minutes, with zero infrastructure to manage. This lesson shows you how to connect services visually and run your first integration without writing a single line of code — the pain of manual glue code ends here.

The problem this lesson solves

Developers waste hours on integration glue: writing polling scripts, handling API authentication, retrying failed calls, and then deploying those fragile scripts somewhere that stays up. Logic Apps solve this by providing a managed, serverless integration platform. You design workflows in a visual designer, and Azure handles the execution, scaling, and retries. The problem this lesson solves is the manual effort and operational overhead of connecting cloud services — you’ll learn to replace that with a declarative, maintainable workflow.

Core concept / mental model

Think of a Logic App as a recipe for your cloud services. Each recipe has three parts: a trigger (the starting ingredient — when to run), actions (the steps — what to do), and connectors (the tools you use, like a whisk or a knife — how to talk to other services). The Logic App itself is a logical container for that recipe. It runs in the cloud, so you don’t need a server, and it follows a serverless model — you pay for what you use, and it scales automatically.

Here’s a picture in words: your Logic App is like a post office. A letter arrives (the trigger — new email, new blob, HTTP request). Postal workers sort it (the actions — parse, transform, route). They might use different vehicles (the connectors — Outlook, SQL Server, SharePoint) to deliver the letter to its final destination. If a vehicle breaks down, the post office retries the delivery automatically. And the post office doesn’t close if a flood of letters comes in — it just hires more temporary workers (scaling).

Key definitions

  • Logic App – The Azure resource that hosts your workflow definition.
  • Trigger – The event that starts your workflow (e.g., HTTP request, new blob, recurrence).
  • Action – A step in your workflow that performs a task (e.g., send email, call API).
  • Connector – A pre-built integration with a service (e.g., Office 365, Salesforce, Azure Blob Storage).
  • Managed connector – Hosted by Microsoft, no code to write, but requires authentication.
  • Workflow – The JSON definition of your Logic App that you can edit in code view.

How it works step by step

  1. Create a Logic App resource in the Azure portal. Choose a Consumption plan (pay-per-execution) for simple, low-cost workflows.
  2. Pick a trigger – the most common for a simple app is an HTTP request (to call it from anywhere) or When a blob is added (to react to file uploads).
  3. Add actions – use the visual designer to search and add connectors. For example, add a Send an email (V2) action to notify you.
  4. Configure each action – set parameters like the recipient, subject, and body. Use dynamic content to insert values from the trigger output.
  5. Test the workflow by sending a request to the HTTP trigger URL (from tools like Postman) and watch the run history in the portal.
  6. Monitor – after a run, open the Run history to see the inputs/outputs of each step, making debugging visual.

The cause → effect chain: trigger fires → each action runs in sequence → failures are retried (default policy) → run history records everything. If an action fails after retries, the workflow stops and you can fix it.

Hands-on walkthrough

Let’s build the classic “Hello World” of Logic Apps: an HTTP-triggered workflow that returns your name and the current time. You’ll need an Azure subscription (free trial works) and access to the Azure portal.

Step 1: Create the Logic App

In the Azure portal, click Create a resource, search for Logic App, and choose Consumption as the plan. Fill in the basics: resource group, name (e.g., my-first-logicapp), and region. Click Create, then Go to resource.

Step 2: Add the HTTP trigger

The designer opens with “Choose a trigger”. Search for When a HTTP request is received. Add it, and you’ll see a Request Body JSON Schema field — leave it empty for now or paste {"type":"object"}. This trigger will give you a HTTP POST URL after you save.

Step 3: Add a response action

Click + New step, search for Response, and select Response. In the Body field, enter a JSON object like this:

{
  "message": "Hello from Logic Apps!",
  "receivedTime": "@{utcNow()}"
}

The expression utcNow() is a built-in function that returns the current UTC time.

Step 4: Save and test

Click Save. The designer will generate a HTTP POST URL — copy it. Open Postman (or curl), send a POST request to that URL, and you’ll get the JSON response:

curl -X POST "https://prod-01.centralus.logic.azure.com:443/workflows/abc123/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=xyz" -H "Content-Type: application/json" -d '{"name":"Alex"}'

Expected response:

{
  "message": "Hello from Logic Apps!",
  "receivedTime": "2025-01-15T14:32:10Z"
}

Step 5: View run history

Back in the portal, open Run history — you’ll see a successful run. Click on it to see each step’s inputs and outputs, confirming the workflow executed as designed.

Compare options / when to choose what

Logic Apps is one of several ways to integrate services in Azure. Here’s how it stacks against the alternatives:

Approach Best for When to avoid Hands-on effort Cost model
Logic Apps Visual integration, low-code, rapid prototyping High-throughput, complex business logic Minimal (drag-and-drop) Consumption: per action execution
Azure Functions Custom code in C#, Python, Node, complex transformations Quick no-code integration High (write and deploy code) Consumption: per execution & GB-s
Power Automate Business users, Microsoft 365 workflows Advanced Azure scenarios Minimal (no-code) Per-user licenses
Azure Data Factory ETL/ELT pipelines, data movement Real-time, event-driven workflows Medium (pipelines) Per activity run
API Management Exposing and managing APIs Internal point-to-point integration High (API design) Per API call

Pro tip: If you need event-driven, low-code integration across many SaaS services, Logic Apps is the fastest path. If you need to process large amounts of data in a pipeline, Data Factory is your tool. If you’re writing custom business logic, Functions gives you full control.

Variations to consider

  • Standard plan Logic Apps: runs on a dedicated runtime, better for enterprise scenarios with VNet integration, but costs more.
  • Power Automate uses the same engine under the hood but is licensed per user — great for non-developers.
  • Azure Functions with Durable Functions can model long-running workflows with code, but you lose the visual designer.

Troubleshooting & edge cases

"Failed to fetch" or 401 when calling the HTTP trigger

  • The trigger URL is generated with a SAS token — make sure you copied the entire URL. It’s time-limited, so if you test later, regenerate it.
  • If you’re calling from a browser, you may get a CORS error — use curl or Postman instead.

"Invalid template" error on save

  • This often happens when a dynamic content expression is malformed. Check that your expressions like @{utcNow()} are properly wrapped and don’t have stray quotes. In code view, validate the JSON against the schema.

Action fails with a connector error (e.g., Outlook "Access denied")

  • Connectors require authentication — you must sign in to the service (e.g., Office 365) when you add the action in the designer. If the token expires, re-authenticate from the connector settings.

Run history shows "Failed" but no visible error

  • Open the run details and look at the failing step’s Output — the error message is usually there. Common causes: insufficient permissions on the target resource, or the target service is down.

Trigger doesn’t fire

  • For blob triggers, the storage account must have blob change notifications enabled — this is a common gotcha.
  • For recurrence triggers, check the timezone and interval — they default to UTC, which may not match your local expectations.

Edge case: Large payloads

  • HTTP actions have a request/response limit (100 MB for requests, 50 MB for responses). If you exceed this, break your workflow into smaller chunks or use Blob Storage for large files.

Edge case: Idempotency

  • If a step fails after a retry, your downstream service might get duplicate calls. Use idempotency keys or design your actions to be idempotent.

What you learned & what's next

You’ve just built a simple Azure Logic App, and in doing so you learned the core mental model: a Logic App is a managed workflow container with a trigger and actions. You applied that model by creating an HTTP-triggered workflow that responds with a dynamic message, and you practiced testing and monitoring. You now understand when to choose Logic Apps over Functions or Data Factory, and you can troubleshoot common issues like authentication and template errors.

These skills are the foundation for integrating nearly any Azure service. Your next lesson in this track should cover Azure Logic App connectors in depth — how to securely connect to services like Azure Blob Storage, Office 365, and SAP, and how to use managed identities for authentication. That’s where you’ll turn a simple response into a production-worthy integration.

Remember: the power of Logic Apps is in the connectors. Master them, and you can automate almost anything with a few clicks.

Practice recap

Try extending your Logic App by adding a second action, such as sending an email to yourself using the Office 365 connector. Use the HTTP trigger’s dynamic content to include the request body in the email. Then check the run history to see the new step’s output and verify the email arrived.

Common mistakes

  • Forgetting to save the Logic App before using the HTTP trigger URL — the URL isn’t generated until you save.
  • Ignoring the SAS token expiry on the HTTP trigger — the URL stops working after a while, causing mysterious 401 errors.
  • Malforming expressions like @@{utcNow()} or using single instead of double quotes in dynamic content fields — this leads to 'Invalid template' errors.
  • Choosing a Standard plan when a Consumption plan would do — paying for a dedicated runtime you don’t need for simple workflows.
  • Not checking the run history's step outputs when troubleshooting, instead of guessing — the error is usually right there.

Variations

  1. Use a Recurrence trigger to run on a schedule instead of an HTTP request, for periodic tasks.
  2. Use Power Automate if you need a more user-friendly, per-user licensed version for business teams.
  3. Use Azure Functions when you need custom code and complex logic beyond visual designer capabilities.

Real-world use cases

  • Automatically copy new files from an Azure Blob Storage container to a SharePoint folder when they are added.
  • Send a Teams message to a support channel when a new ticket is created in a CRM system.
  • Trigger a serverless backup process by calling an HTTP endpoint from a monitoring tool like Datadog.

Key takeaways

  • A Logic App is a serverless workflow container — you define triggers and actions, and Azure handles execution and scaling.
  • Triggers fire the workflow (HTTP, blob, recurrence), actions perform the work (send email, call API), connectors handle integration.
  • You can build a functional workflow in minutes using the visual designer with no code, and test it with a simple curl or Postman request.
  • Consumption plan is cost-effective for simple apps; Standard plan is for enterprise needs with VNet integration.
  • Run history is your debugging window — inspect step inputs/outputs to diagnose failures quickly.
  • Master dynamic content expressions like @utcNow() to make workflows reactive and flexible.

Sponsored

Sponsored

Discussion

Questions, corrections, and tips help everyone reading this page.

0 comments

Add a comment

Shown publicly with your comment.

Be constructive · max 4,000 characters

No comments yet — start the thread.

Related tutorials, quizzes, and articles for this topic.