Azure Logic Apps
Azure Logic Apps is a cloud platform for building and running automated workflows that integrate applications, data, services, and systems across an enterprise with minimal code.
Overview
Azure Logic Apps is a managed workflow and enterprise integration platform. A workflow starts from a trigger and coordinates built-in operations, managed connectors, control flow, transformations, HTTP calls, messaging, B2B artifacts, and custom code. Consumption and Standard have different hosting, billing, networking, deployment, and workflow capabilities; Standard supports multiple stateful or stateless workflows in a single-tenant runtime. Production design must make delivery semantics, retries, run-after behavior, idempotency, timeouts, concurrency, secrets, managed identity, connector limits, run-history sensitivity, observability, resubmission, disaster recovery, and cost explicit. Logic Apps is strongest when orchestration and connectors dominate; complex domain rules still belong in testable application code.
What you will learn
- Explain triggers, actions, connectors, control flow, and workflow expressions.
- Compare Consumption, Standard, stateful, stateless, and hybrid choices.
- Design retry-safe integrations with idempotency, timeouts, scopes, and compensation.
- Secure managed connectors, HTTP endpoints, identities, networking, and run history.
- Version and deploy workflow artifacts with infrastructure as code.
- Monitor throttling, latency, failures, backlog, recovery, and cost.
Prerequisites
- HTTP, JSON, asynchronous workflows, queues, APIs, and eventual consistency.
- OAuth, managed identity, Azure RBAC, Key Vault, private networking, and DNS.
- Source control, Bicep, deployment pipelines, and operational monitoring.
When to use Azure Logic Apps
Good fit
- A workflow primarily coordinates supported systems and connectors.
- Long-running integration needs visible state, retries, approvals, or B2B processing.
- Operations teams benefit from run-level inspection and controlled resubmission.
Choose another approach when
- The workload is primarily complex computation or domain logic.
- Required latency, throughput, connector limits, or cost do not fit.
- A simple direct API or queue consumer has no meaningful orchestration.
Key concepts
A trigger creates a workflow run; actions execute connectors, data operations, conditions, loops, scopes, functions, or HTTP calls.
Built-in connectors run with the runtime, while managed connectors use Azure-hosted API connections with distinct authentication, limits, and billing.
Stateful workflows persist execution state and history for durability; stateless Standard workflows favor short low-latency executions with important capability limits.
Consumption is multitenant and execution-metered; Standard is single-tenant, plan-based, hosts multiple workflows, and supports local development and richer networking.
Conditions, switches, loops, parallel branches, scopes, run-after status, terminate actions, and tracked properties express orchestration and error paths.
Triggers and actions can retry or replay, so external side effects require stable business keys, idempotent APIs, and explicit resubmission rules.
Schemas, maps, partners, agreements, certificates, and EDI protocols support governed enterprise document exchange.
Run history, diagnostics, connector throttles, workflow versions, parameters, identities, private networking, cost, and recovery need ownership.
Architecture
A trigger fires the workflow; each action calls a connector or runs inline code; the workflow state is persisted between steps for long-running orchestrations and surfaced in the run history for monitoring.
Conceptual architecture · Adapt to your system context
Implementation walkthrough
Build the critical path deliberately, then verify its observable behavior.
- 01Map the workflow contract
Define trigger, inputs, outputs, correlation, owners, SLOs, data classification, and completion semantics.
- 02Choose hosting and state
Select Consumption or Standard and stateful or stateless behavior from networking, duration, volume, latency, and cost.
- 03Design connector identity
Prefer managed identity, grant least privilege, configure networks, and isolate environment connection metadata.
- 04Model the happy and failure paths
Use scopes, run-after, retry, timeout, termination, compensation, and idempotent targets.
- 05Parameterize and source control
Version workflow JSON, connections metadata, schemas, maps, settings, and Bicep without secrets.
- 06Test realistic behavior
Cover malformed input, connector throttling, retries, duplicates, timeout, cancellation, and replay.
- 07Deploy and operate
Promote immutable artifacts, smoke test, alert, control resubmission, and rehearse dependency and regional recovery.
Code example
Logic Apps workflows are JSON definitions — this excerpt shows an HTTP trigger, a Service Bus send action, and a conditional branch, the same structure visible in the visual designer.
// Calling a Logic Apps workflow from .NET using HTTP trigger
using System.Net.Http.Json;
public sealed class OrderWorkflowClient(HttpClient http)
{
public async Task TriggerOrderApprovalAsync(
Guid orderId, decimal total, CancellationToken ct)
{
// Logic Apps exposes an HTTP trigger URL with a SAS key
var response = await http.PostAsJsonAsync(
string.Empty, // Base URL set in HttpClient config
new
{
orderId = orderId.ToString(),
total,
requestedAt = DateTime.UtcNow
},
ct);
response.EnsureSuccessStatusCode();
}
}
// Registration with typed client
builder.Services.AddHttpClient<OrderWorkflowClient>(client =>
{
client.BaseAddress = new Uri(
builder.Configuration["LogicApps:OrderApprovalUrl"]!);
});
// Equivalent workflow definition (abridged JSON)
// {
// "definition": {
// "triggers": {
// "manual": { "type": "Request", "kind": "Http" }
// },
// "actions": {
// "Send_approval_email": {
// "type": "ApiConnection",
// "inputs": { "host": { "connection": { "name": "office365" } } }
// },
// "Check_approval": {
// "type": "If",
// "expression": { "equals": ["@body('Send_approval_email')", "Approve"] },
// "actions": { "Notify_orders_service": { "type": "Http" } }
// }
// }
// }
// }Testing strategy
Test definitions, custom code, connectors, and deployed orchestration at the correct boundaries.
- Validate workflow JSON, expressions, parameter references, schemas, and forbidden secrets in CI.
- Unit test target APIs and inline or custom code independently.
- Use isolated resources to test real connector authentication, throttling, pagination, and payload behavior.
- Force Failed, TimedOut, Skipped, and throttled actions to verify scopes and run-after paths.
- Replay the same trigger and resubmit a run to prove idempotent side effects.
- Load test concurrency, action count, backlog, duration, connector limits, and cost.
Security considerations
Protect every trigger, connector, identity, parameter, network path, and recorded payload.
- Authenticate request triggers with Entra ID or a suitable gateway rather than relying only on secret URLs.
- Use managed identity and least-privilege roles for supported Azure connectors.
- Store secrets outside definitions and protect connection resources and deployment parameters.
- Use private endpoints or VNet integration where the selected hosting model supports them.
- Enable secure inputs and outputs and avoid PII or secrets in run history and tracked properties.
- Restrict workflow editing, resubmission, and run-history access with RBAC and audit.
Performance and scalability
Workflow throughput is constrained by runtime capacity, connector limits, action design, and downstream systems.
- Measure trigger latency, run duration, action latency, throttles, retries, backlog, and cost.
- Use stateless workflows only when their execution and connector constraints fit.
- Control loop concurrency and avoid unbounded parallel calls to a limited dependency.
- Batch or chunk data deliberately and avoid large repeated transformations.
- Use asynchronous messaging for long dependency waits instead of holding HTTP calls.
- Model managed connector metering even on Standard plans.
Deployment and operations
Treat workflow definitions and connection metadata as application artifacts.
- Separate reusable definitions from environment parameters and connection resources.
- Deploy identities, networking, connections, workflows, diagnostics, and alerts with code.
- Use federated pipeline identity and least-privilege deployment roles.
- Validate definitions and run smoke workflows before promotion.
- Keep compatible target APIs during rollout and preserve idempotency across versions.
- Document forward repair, resubmission, rollback, and regional recovery.
Common problems and fixes
Action is skipped unexpectedly
Likely cause: Its run-after condition does not include the prior action status.
Fix: Inspect run history and configure explicit Succeeded, Failed, TimedOut, or Skipped dependencies.
Workflow repeats a side effect
Likely cause: A trigger, action retry, timeout, or resubmission replayed non-idempotent work.
Fix: Add a stable key and atomic idempotency record at the target before enabling replay.
Connector returns throttling errors
Likely cause: Loop concurrency or run volume exceeds connector or target limits.
Fix: Inspect retry headers and connector metrics, reduce concurrency, batch safely, and request capacity only after measurement.
Works in designer but deployment fails
Likely cause: Connection references, parameters, app settings, identity, or artifact layout differ.
Fix: Validate source-controlled definitions and environment mappings and deploy all dependencies in order.
Run history exposes sensitive data
Likely cause: Inputs, outputs, tracked properties, or diagnostics record payloads.
Fix: Enable secure inputs and outputs, minimize sensitive fields, restrict RBAC, and apply retention controls.
Best practices
- Choose Logic Apps when connector orchestration and workflow visibility outweigh custom computation.
- Choose Consumption versus Standard from hosting, networking, latency, volume, workflow type, deployment, and cost evidence.
- Use managed identity for supported connectors and protect unavoidable connection credentials and parameters.
- Design every retried side effect to be idempotent and carry stable workflow, correlation, and business identifiers.
- Group failure-prone actions in scopes and configure explicit run-after, retry, timeout, compensation, and terminate behavior.
- Keep workflow definitions, connections metadata, schemas, maps, and infrastructure in source control and CI/CD.
- Minimize sensitive data in trigger inputs, outputs, run history, tracked properties, and diagnostics.
- Monitor failures, throttles, duration, backlog, action latency, abandoned runs, connector health, and cost.
Production checklist
- Hosting plan and workflow state match networking, latency, volume, duration, and cost.
- Triggers, connectors, identities, secrets, and networks use deliberate least-privilege controls.
- Retries, timeouts, run-after, compensation, idempotency, and resubmission are designed together.
- Workflow, connection metadata, schemas, maps, parameters, and infrastructure are versioned.
- Connector limits, concurrency, payload sizes, action count, and cost are load tested.
- Failures, throttles, duration, backlog, abandoned runs, and sensitive telemetry have alerts and owners.
- Deployment, rollback, replay, dependency failure, and regional recovery are rehearsed.
Common interview questions
When choose Logic Apps over Functions?
Choose Logic Apps for connector-heavy visible orchestration and enterprise integration; choose Functions for compute-heavy custom logic, fine-grained testing, or runtime control.
Standard versus Consumption?
Consumption is multitenant and metered per execution. Standard uses a single-tenant plan, supports multiple workflows, stateful or stateless execution, local development, and richer networking.
Stateful versus stateless?
Stateful persists run state and history for durable long-running work. Stateless keeps execution state in memory for short lower-latency flows and has different connector and action constraints.
How are failures modeled?
Actions expose Succeeded, Failed, Skipped, and TimedOut status. Run-after conditions, scopes, retry policies, compensation actions, and Terminate define the failure path.
How do you prevent duplicate side effects?
Pass a stable business or workflow-run key to an idempotent target, record completion atomically, and define safe retry and resubmission behavior.
How do you secure connector access?
Prefer managed identity where supported, grant least-privilege roles, protect API connections and parameters, restrict networks, and suppress sensitive run data.
Dedicated GitHub sample
Clone, run, test, and modify the focused implementation created for this guide.
Logic Apps Order Approval
A source-controlled Logic Apps workflow, Bicep deployment, and .NET 10 idempotent callback API with retry-safe workflow run handling.
- Run
dotnet run --project src/LogicAppsOrderApproval- Test
dotnet test LogicAppsOrderApproval.slnx