Skip to content

Add Container App specific error handling and guidance #6799

@spboyer

Description

@spboyer

Problem

Container App errors account for ~3,152 errors (2.46%) over 90 days. These errors pass through the generic ARM error parser with no Container App-specific guidance, making it difficult for users to diagnose and fix common issues like invalid secrets, image pull failures, or configuration errors.

Current Behavior

In pkg/containerapps/container_app.go, Container App errors are handled generically:

  • Line 269: SDK errors are wrapped with polling for container app update completion: <error>
  • Lines 649-656: withApiVersionSuggestion() wraps unmarshalling errors with an API version mismatch suggestion
  • ARM-level Container App errors (e.g., ResourceNotFound for Microsoft.App/containerApps) flow through the generic getErrorsFromMap recursive parser in azure_deployment_error.go

There is no detection of ContainerAppOperationError codes or Container Apps-specific error patterns.

Proposed Solution

  1. Detect ContainerAppOperationError and ContainerAppSecretInvalid in the ARM error tree during deployment error processing
  2. Add targeted error messages for common Container App failures:
    • Invalid or missing secrets: A secret referenced by the container app does not exist. Check your secret definitions in the Bicep template.
    • Image pull failures: The container image could not be pulled. Verify the image name, tag, and registry credentials.
    • Configuration errors: The container app configuration is invalid. Run 'az containerapp show --name <app> -g <rg>' to inspect the current state.
  3. Surface container app revision logs URL when available to help users debug runtime failures
  4. Consider adding az containerapp logs show command suggestion for runtime debugging

Data Reference

Source: AzdProvisionErrorsByTemplate + AzdDeploymentErrorsByTemplate (DevCli on ddazureclients)

  • Container App Error: 3,152 (2.46%)
  • Key ARM codes: ContainerAppOperationError, ContainerAppSecretInvalid
  • Awesome-azd: 2.19%, AI templates: lower (fewer Container App workloads)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions