microsoft / microsoft/aspire

.WithContainerRegistry has no effect when deploying to Kubernetes

Open
#14,011 2 comments 2 reactions 0 assignees View on GitHub
area-app-model
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

Sample code
```
var webFrontend = builder.AddProject("mi-webfrontend")
.WithContainerRegistry(registry); // "mienvacrzbqryxzh6p5lu.azurecr.io"
```
When publishing to Kubernetes with `aspire publish` is producing artefacts which are ignoring the registry URL altogether.

Produced YAML is missing the registry URL and therefore containers have image pull errors
```
parameters:
mi_webfrontend:
port_http: "8080"
port_https: "8080"
mi_webfrontend_image: "mi-webfrontend:latest"

```

### Expected Behavior

Registry URL added to the image in the YAML output

### Steps To Reproduce
Use above code.

### Exceptions (if any)
None

### .NET Version info
10.0

### Anything else?
No

Contributor guide

Open the contributing guide

Research direction

Start by tracing how AddProject and WithContainerRegistry values flow into the Kubernetes output produced by `aspire publish`. Reproduce the sample deployment and inspect the generated YAML, then verify that the container image includes the configured registry URL and no longer causes image pull errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, kubernetes
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.