Microsoft Azure

Orchestration — Durable Functions & Logic Apps

Coordinate multi-step workflows with retries and compensation, in code or in a designer.

Two orchestrators, aimed at different authors.

A production line with a written procedure at each station — what to do, how often to retry, and which earlier steps to undo if this one fails for good.

Key Concepts

1
    Durable Functions  workflow as CODE, in the Functions runtime
    Logic Apps         workflow as a DESIGNER, 1,000+ connectors
2
Durable Functions writes the workflow as a function.
    [FunctionName("ProcessOrder")]
    public static async Task Run([OrchestrationTrigger] IDurableOrchestrationContext ctx)
    {
        var order = ctx.GetInput<Order>();
        await ctx.CallActivityAsync("ValidateOrder", order);
        try {
            await ctx.CallActivityAsync("ChargeCard", order);
        } catch {
            await ctx.CallActivityAsync("ReleaseStock", order);
            throw;
        }
        await ctx.CallActivityAsync("Ship", order);
    }
3
It survives restarts by replaying. The orchestrator function runs from the beginning each time it resumes, and completed activity results are replayed from history rather than re-executed.
4
Which forces one rule: orchestrator code must be deterministic. No DateTime.Now, no Guid.NewGuid(), no direct I/O — use ctx.CurrentUtcDateTime and activities instead. Breaking that is the classic Durable Functions bug, and it is a favourite question.
DateTime.NowGuid.NewGuid()ctx.CurrentUtcDateTime
5
The patterns it is built for.
    chaining        A then B then C
    fan-out/fan-in  run N activities in parallel, await all
    async HTTP      return 202 with a status URL
    human approval  wait for an external event, with a timeout
    eternal         a loop that restarts itself cleanly
6
Logic Apps is the low-code option, and its strength is connectors — Office 365, Salesforce, SAP, FTP, SQL — so integration work that would be weeks of SDK code becomes configuration.
7
    Consumption   per-action billing, multi-tenant
    Standard      single-tenant, VNet, predictable cost
8
Choosing between them. Developer-owned logic with unit tests and source control: Durable Functions. Integration across SaaS systems, or a workflow that non-developers will maintain: Logic Apps.
9
Both make the saga explicit. There is no distributed transaction, so each step needs a compensating action, and failure walks them backwards — which is far easier to see in a declared workflow than buried in service code.
10
What the interviewer is probing.1. "Why must orchestrator code be deterministic?" Probing: the replay model, which is the classic question. Stalls: "It is a style rule." Moves up: the orchestrator replays from the beginning on every resume, so DateTime.Now or Guid.NewGuid would produce different values and corrupt the state.
11
2. "How do you get the current time in an orchestrator?" Probing: the API. Stalls: "DateTime.UtcNow." Moves up: ctx.CurrentUtcDateTime, which replays consistently.
12
3. "Durable Functions or Logic Apps?" Probing: the author. Stalls: "Whichever is cheaper." Moves up: Durable Functions when the logic belongs in source control with tests; Logic Apps when the work is integrating SaaS systems through connectors.
13
4. "How do you wait for a human approval that may take days?" Probing: external events. Stalls: "Poll in a loop." Moves up: wait for an external event with a timeout — the orchestration consumes nothing while waiting, for up to a year.