Azure Container Apps Job exits with code 0, then hits DeadlineExceeded

J P 0 Reputation points
2026-11-25T12:59:51.79+00:00

We observed this in a nonproduction Azure Container Apps environment in East US 2 using a Consumption workload profile. The manual job has one container, requires one successful replica, has zero automatic retries, and has a 120-second deadline.

The job sent a synthetic report to a private endpoint. Azure Monitor recorded HTTP 201, the receiving app confirmed that it wrote one receipt, and the sender container exited after about 9 seconds with code 0 and reason ProcessExited. Azure kept the job active until the 120-second deadline, then deleted the replica and marked the execution Failed with DeadlineExceeded.

What would cause the job to remain active after the container exits successfully? Which diagnostic events would help determine whether Azure registered the replica as complete? I can share the execution ID and system events privately with Microsoft support.

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 11,055 Reputation points
    2026-11-26T08:06:30.2766667+00:00

    Hello @J P

    A successful exit from the application container doesn’t by itself mark the job execution as successful. Container Apps must also observe the replica reaching its completed state. DeadlineExceeded means the replica didn’t reach that state before replicaTimeout expired, even though the application container reported exit code 0.

    The usual explanations are:

    • Another configured container or sidecar remained active.
    • The job controller didn’t register the replica’s completion.
    • Less commonly, the execution’s completion-count or parallelism settings don’t match the intended single-replica configuration.

    First, inspect the execution’s detailed replica and container states:

    az containerapp job execution show \
      --name "<job-name>" \
      --resource-group "<resource-group>" \
      --job-execution-name "<execution-name>" \
      --output json
    

    Check properties.detailedStatus.replicas[].containers[]. The response exposes the status and exit code of every container known to the execution, which can reveal a container that never completed.

    Also verify the job configuration:

    az containerapp job show \
      --name "<job-name>" \
      --resource-group "<resource-group>" \
      --query "properties.configuration"
    

    For this scenario, confirm:

    replicaTimeout: 120
    replicaRetryLimit: 0
    replicaCompletionCount: 1
    parallelism: 1
    

    Then query the complete sequence of platform events:

    ContainerAppSystemLogs_CL
    | where TimeGenerated > ago(24h)
    | where JobName_s == "<job-name>"
    | project TimeGenerated, JobName_s, ReplicaName_s,
              EventSource_s, Reason_s, Log_s
    | order by TimeGenerated asc
    

    For the affected replica, correlate its console records:

    ContainerAppConsoleLogs_CL
    | where TimeGenerated > ago(24h)
    | where JobName_s == "<job-name>"
    | where ContainerGroupName_s == "<replica-name>"
    | project TimeGenerated, ContainerGroupName_s,
              ContainerName_s, Stream_s, Log_s
    | order by TimeGenerated asc
    

    The important event sequence is:

    1. Replica scheduled.
    2. Image pulled and container started.
    3. Container terminated with code 0.
    4. Replica or job completion event or its absence.
    5. DeadlineExceeded and replica deletion.

    Microsoft’s public Container Apps repository contains a report with this same pattern in workload-profile environments: the container exits successfully, but the job controller never records completion and eventually applies DeadlineExceeded. The report concerned another region, so it doesn’t prove that East US 2 is affected, but the matching event sequence makes a platform-side completion-registration issue a credible possibility.

    I’d also run a minimal job such as busybox with sh -c "echo done; exit 0" in the same environment. If that job exhibits the same behavior, it strongly isolates the issue from the application, private endpoint, and HTTP operation.

    Increasing replicaTimeout would only postpone the failure if the completion event is never registered. If the execution details show every container as Succeeded but no replica-completion event appears, open a Microsoft support case with:

    • Environment resource ID and workload-profile configuration
    • Job and execution names
    • Replica name
    • UTC start, container-exit, and timeout timestamps
    • Full system-event sequence
    • Output of az containerapp job execution show
    • Confirmation that a minimal exit-zero job reproduces the behavior

    References:


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.