Foundry Hosting integration automatically deploys capabilityHosts subresource, no clear way to disable it
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Referencing existing Foundry resource and project resource automatically deploys a capabilityHosts subresource and hangs until it is deployed.
I found ClearDefaultRoleAssignments to prevent role deployments (also an annoying one) but there is no clear way to disable the capabilityHosts deployment.
### Expected Behavior
Referencing existing resources should not start deploying things. Especially not without confirmation by the user.
### Steps To Reproduce
Have an existing Foundry resource with an existing project.
Add Aspire.Hosting.Foundry 13.5.4-preview.1.26464.4 to your project
Run
```csharp
var existingFoundryName = builder.AddParameter("existingFoundryName");
var existingFoundryProject = builder.AddParameter("existingFoundryProject");
var existingFoundryResourceGroup = builder.AddParameter("existingFoundryResourceGroup");
var foundry = builder.AddFoundry("foundry")
.AsExisting(existingFoundryName, existingFoundryResourceGroup)
.ClearDefaultRoleAssignments();
var foundryProject = foundry.AddProject("foundry-project")
.AsExisting(existingFoundryProject, existingFoundryResourceGroup);
```
### Exceptions (if any)
_No response_
### Aspire doctor output
```plain
```
### Anything else?
_No response_
Contributor guide
Research direction
Start by reproducing the issue with Aspire.Hosting.Foundry 13.5.4-preview.1.26464.4, then inspect the AddFoundry and AsExisting paths for where capabilityHosts deployment is triggered. Done means referencing existing Foundry and project resources no longer starts capabilityHosts deployment or hangs, while the existing ClearDefaultRoleAssignments behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100