microsoft / microsoft/aspire.dev

[13.2] Document new contextual endpoint resolution apis.

Open
#366 1 comment 1 reaction 2 assignees View on GitHub

@IEvangelist is already working on this.

Since Feb 5, 2026.

Dominant language
MDX
Stars
193
Forks
87
Avg merge
1d 22h
Merged PRs (30d)
73

Description

You can now resolve endpoints from the perspective of specific resources. Depending on your ocnext, the same resource could be `http://host.docker.internal:1234`, `http://localhost:1234` or `http://resource.dev.internal:4567` depending on where you resolved it from.

```cs
var endpoint = redis.GetEndpoint("tcp")
var url = await endpoint.GetValueAsync(new ValueProviderContext {
Caller = containerApp.Resource,
});
```

You can also resolve the url from the perspective of a specific network:

```cs
var endpoint = redis.GetEndpoint("tcp")
var url = await endpoint.GetValueAsync(new ValueProviderContext {
Network = KnownNetworkIdentifiers.DefaultAspireContainerNetwork
});
```

(Note, the APIs for this all existed in 13.1, they just didn't behave as you'd expect them to)

References:
- https://github.com/dotnet/aspire/issues/7153
- https://github.com/dotnet/aspire/pull/14278

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.