microsoft-foundry / microsoft-foundry/foundry-samples

[Hosted Agent][azd CLI] Deployment stuck at "Create/Update capability host" when using an existing Foundry Project

Open
#455 2 comments 0 reactions 2 assignees View on GitHub

@ankitbko is already working on this.

Since Jun 18, 2026.

Dominant language
Bicep
Stars
445
Forks
494
Avg merge
11h 35m
Merged PRs (30d)
38

Description

When registering a Hosted Agent via Azure Container Registry using the Azure Developer CLI (azd), the deployment gets stuck in a pending state at the "Create/Update capability host" step.

This issue occurs only when reusing an existing Azure AI Foundry Resource and Foundry Project where a capability host already exists.

If the same workflow is executed by creating a brand-new Foundry Resource and Foundry Project from scratch, the deployment completes successfully.

Documentation Followed
The deployment was executed exactly as described in the official documentation:
https://learn.microsoft.com/en-us/azure/ai-foundry/agents/concepts/hosted-agents?view=foundry&tabs=cli#create-a-hosted-agent-by-using-the-azure-developer-cli
No steps were skipped or modified.

Environment
Deployment Method: Azure Developer CLI (azd)
Agent Type: Hosted Agent (container-based, ACR-backed)
Container Registry: Azure Container Registry (ACR)
Azure AI Foundry Resource: Existing
Azure AI Foundry Project: Existing
Capability Host: Already created, I also tried after deleting the previous Capability Host once
Authentication: azd logged in with sufficient permissions

Steps to Reproduce
Create an Azure AI Foundry Resource and Foundry Project.
Create a capability host in the Foundry Project (successfully).
At a later time, attempt to register a new Hosted Agent using:
azd up

Actual Result
(✓) Done: Resource group: msfoundry-rg (2.499s)
(✓) Done: Foundry: foundry-lhnjfq (20.509s)
(✓) Done: Azure AI Services Model Deployment: foundry-lhnjfq/gpt-4o-mini (1.46s)
(✓) Done: Log Analytics workspace: logs-upxjfukq2bpkg (24.225s)
(✓) Done: Foundry project: foundry-lhnjfq/msfoundry-prj1 (9.351s)
(✓) Done: Application Insights: appi-upxjfukq2bpkg (4.351s)
(✓) Done: Container Registry: crupxjfukq2bpkg (21.489s)
| | Creating/Updating resources (Foundry capability host)
|= | Creating/Updating resources (Foundry capability host)
|== | Creating/Updating resources (Foundry capability host)
|=== | Creating/Updating resources (Foundry capability host)
| | Creating/Updating resources (Foundry capability host)
|= | Creating/Updating resources (Foundry capability host)
|== | Creating/Updating resources (Foundry capability host)
|== | Creating/Updating resources (Foundry capability host)^C(

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.