Skip to content

Surface ARM error.message text for opaque InvalidTemplateDeployment failures #7264

Description

@spboyer

Problem

1,017 InvalidTemplateDeployment errors per month (21.6% of all ITD errors) have no deeper error code in the chain — InvalidTemplateDeployment is the terminal frame. Users see a generic template validation error with no detail about what failed.

However, the ARM API response body contains an error.message field with human-readable text explaining the specific validation failure. This message is not currently surfaced in azd's error output.

Telemetry Data (March 2026, 23 days)

Metric Value
Opaque ITD errors (no deeper code) 1,017
Unique machines affected 366
Avg wait before failure 122s
User-hours wasted/month ~35h

Service Breakdown of Opaque Errors

Service Target Count Share
(unknown) 231 23%
containerapp 200 20%
function 146 14%
containerapp-dotnet (multi) 79+ 8%
azure.ai.agent 61 6%
appservice 42 4%

User Impact

  • 65% of these users retry and fail again — the current error output gives them no information to guide a fix
  • Container Apps (all variants) accounts for 47% of opaque errors

Proposed Solution

In the ARM deployment error handling code (likely deployments.go or bicep_provider.go), when parsing ARM error responses:

  1. Capture error.message (and nested error.details[].message) in addition to error.code
  2. Surface the message text in the error suggestion output or the deployment error display
  3. For the telemetry error.service.errorcode field, consider adding a frame for the message content or a hash of it, so future analysis can classify these errors

Relationship to Other PRs

Example

Today:

ERROR: deployment failed: error deploying infrastructure: InvalidTemplateDeployment

After this fix:

ERROR: deployment failed: InvalidTemplateDeployment
  → The resource 'myapp-containerapp' property 'configuration.ingress.targetPort' value '0' is invalid.
    Must be between 1 and 65535.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions