Skip to content

azd ai extension: intermittent deployment failure due to no container registry #6216

Description

@paulbatum
  • Make sure you've installed the latest version using instructions

Output from azd version

PS C:\Users\pbatum> azd version
azd version 1.22.0-beta.1-daily.5575132 (commit 9cf0eb73d00423ee2a39e5cc03f73756aec354ae)
PS C:\Users\pbatum> azd ext list
Id                        Name                                  Version        Installed Version  Source
azure.ai.agents           Azure AI Agents (preview)             0.1.0-preview  0.1.0-preview      azd
azure.coding-agent        Coding agent configuration extension  0.5.1                             azd
microsoft.azd.demo        Demo Extension                        0.3.0                             azd
microsoft.azd.extensions  AZD Extensions Developer Kit          0.6.0                             azd

Describe the bug
Sometimes azd up does not create a container registry, and this causes the following error:

ERROR: error executing step command 'deploy --all': failed publishing service 'CalculatorAgentLG': failed publishing container: rpc error: code = Unknown desc = could not determine container registry endpoint, ensure 'registry' has been set in the docker options or 'AZURE_CONTAINER_REGISTRY_ENDPOINT' environment variable has been s

container registry is clearly absent in the list of resources provisioned:

Image

Simply running azd up again resolved the issue. the container registry creation was included in this second run:

Image

To Reproduce
I don't have reliable repro steps. it happens maybe 1 out of 5 runs through the full experience from a blank directory.

Expected behavior
container registry should always be provisioned

Environment
Repros on powershell on Windows, using
Windows Terminal
Version: 1.23.12811.0

** Additional Context **

Below is the output and files from the first azd up

2025/11/17 14:06:49 server.go:137: AZD gRPC Server stopped
PS D:\code\temp\cobo-demo\run41az> azd up

Packaging services (azd package)

  (✓) Done: Packaging service CalculatorAgentLG
  - No artifacts were found


Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time.

Subscription: azure-openai-agents-exp-nonprod-01 (921496dc-987f-410f-bd57-426eb2611356)
Location: North Central US

  You can view detailed progress in the Azure Portal:
  https://portal.azure.com/#view/HubsExtension/DeploymentDetailsBlade/~/overview/id/%2Fsubscriptions%2F921496dc-987f-410f-bd57-426eb2611356%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fpbatum-run41az-1763417221

  (✓) Done: Resource group: rg-pbatum-run41az (1.725s)
  (✓) Done: Azure AI Services: ai-account-gicajzcb4zkmq (23.328s)
  (✓) Done: Log Analytics workspace: logs-gicajzcb4zkmq (22.015s)
  (✓) Done: Application Insights: appi-gicajzcb4zkmq (2.135s)

Deploying services (azd deploy)

  (x) Failed: Deploying service CalculatorAgentLG

ERROR: error executing step command 'deploy --all': failed publishing service 'CalculatorAgentLG': failed publishing container: rpc error: code = Unknown desc = could not determine container registry endpoint, ensure 'registry' has been set in the docker options or 'AZURE_CONTAINER_REGISTRY_ENDPOINT' environment variable has been set

azure.yaml

# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json

requiredVersions:
    extensions:
        azure.ai.agents: '>=0.1.0-preview'
name: ai-foundry-starter-basic
services:
    CalculatorAgentLG:
        project: src/CalculatorAgent
        host: azure.ai.agent
        language: docker
        docker:
            remoteBuild: true
        config:
            container:
                resources:
                    cpu: "1"
                    memory: 2Gi
                scale:
                    maxReplicas: 3
                    minReplicas: 1
            deployments:
                - model:
                    format: OpenAI
                    name: gpt-4o-mini
                    version: "2024-07-18"
                  name: gpt-4o-mini
                  sku:
                    capacity: 10
                    name: GlobalStandard
infra:
    provider: bicep
    path: ./infra

.env

AI_PROJECT_DEPLOYMENTS="[{\\\"name\\\":\\\"gpt-4o-mini\\\",\\\"model\\\":{\\\"name\\\":\\\"gpt-4o-mini\\\",\\\"format\\\":\\\"OpenAI\\\",\\\"version\\\":\\\"2024-07-18\\\"},\\\"sku\\\":{\\\"name\\\":\\\"GlobalStandard\\\",\\\"capacity\\\":10}}]"
APPLICATIONINSIGHTS_CONNECTION_STRING="InstrumentationKey=REDACTED-KEY;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/;LiveEndpoint=https://northcentralus.livediagnostics.monitor.azure.com/;ApplicationId=REDACTED-APP-ID"
AZURE_AI_ACCOUNT_ID="/subscriptions/REDACTED-SUBSCRIPTION-ID/resourceGroups/rg-pbatum-run41az/providers/Microsoft.CognitiveServices/accounts/REDACTED-AI-ACCOUNT"
AZURE_AI_ACCOUNT_NAME="REDACTED-AI-ACCOUNT"
AZURE_AI_FOUNDRY_PROJECT_ID="/subscriptions/REDACTED-SUBSCRIPTION-ID/resourceGroups/rg-pbatum-run41az/providers/Microsoft.CognitiveServices/accounts/REDACTED-AI-ACCOUNT/projects/ai-project-pbatum-run41az"
AZURE_AI_PROJECT_ACR_CONNECTION_NAME=""
AZURE_AI_PROJECT_ENDPOINT="https://REDACTED-AI-ACCOUNT.services.ai.azure.com/api/projects/ai-project-pbatum-run41az"
AZURE_AI_PROJECT_ID="/subscriptions/REDACTED-SUBSCRIPTION-ID/resourceGroups/rg-pbatum-run41az/providers/Microsoft.CognitiveServices/accounts/REDACTED-AI-ACCOUNT/projects/ai-project-pbatum-run41az"
AZURE_AI_PROJECT_NAME="ai-project-pbatum-run41az"
AZURE_AI_SEARCH_CONNECTION_NAME=""
AZURE_AI_SEARCH_SERVICE_NAME=""
AZURE_CONTAINER_REGISTRY_ENDPOINT=""
AZURE_ENV_NAME="pbatum-run41az"
AZURE_LOCATION="northcentralus"
AZURE_OPENAI_ENDPOINT="https://REDACTED-AI-ACCOUNT.openai.azure.com/"
AZURE_RESOURCE_GROUP="rg-pbatum-run41az"
AZURE_STORAGE_ACCOUNT_NAME=""
AZURE_STORAGE_CONNECTION_NAME=""
AZURE_SUBSCRIPTION_ID="REDACTED-SUBSCRIPTION-ID"
AZURE_TENANT_ID="REDACTED-TENANT-ID"
BING_CUSTOM_GROUNDING_CONNECTION_ID=""
BING_CUSTOM_GROUNDING_CONNECTION_NAME=""
BING_CUSTOM_GROUNDING_NAME=""
BING_GROUNDING_CONNECTION_ID=""
BING_GROUNDING_CONNECTION_NAME=""
BING_GROUNDING_RESOURCE_NAME=""
ENABLE_HOSTED_AGENTS="true"

Metadata

Metadata

Assignees

No one assigned

    Labels

    ext-agentsazure.ai.agents extension

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions