Skip to content

Regression: azd ai agent init --image omits service image in azure.yaml #8878

Description

@m5i-work

Description

azd ai agent init --image <prebuilt-image> should generate a unified azure.yaml agent service that carries the pre-built container image on the service-level image: field.

Instead, the generated project omitted services.<agent>.image, so azd deploy treated the service as a normal Docker build and attempted to build/publish a container from src/<agent>/Dockerfile.

Repro

azd ai agent init --no-prompt \
  --agent-name my-agent \
  --image myacr.azurecr.io/agents/my-agent:v1

rg "image:" azure.yaml src/my-agent/agent.yaml || true
azd deploy --no-prompt

Expected

azure.yaml contains the pre-built image at the service level:

services:
  my-agent:
    host: azure.ai.agent
    image: myacr.azurecr.io/agents/my-agent:v1

azd deploy should use the pre-built image path and skip Dockerfile build/package/publish.

Actual

azure.yaml has no service-level image: field. Deploy falls through to Docker build and fails when no Dockerfile exists, for example:

container publish failed: rpc error: code = Unknown desc = remote build failed: open .../src/<agent>/Dockerfile: no such file or directory

Notes

This is a regression in the not-yet-shipped --image flow after the unified azure.yaml agent definition work. The extension needs to write the pre-built image to ServiceConfig.Image, and core must preserve non-empty osutil.ExpandableString values when saving azure.yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions