Endpoint visible for container #5954
Answered
by
davidfowl
Sławomir Rosiek (rosieks)
asked this question in
Q&A
|
I strugle with getting correct endpoint. I have the following setup:
I have plugin for Grafana that calls keycloak to get bearer token to access my api. To get keycloak adress I call |
Answered by
davidfowl
Oct 4, 2024
Replies: 1 comment 6 replies
|
Show your app host code. Currrrently container to container networking required some understanding of the APIs. That will improve in Aspire 9, but I can show you how to make it work. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry for taking so long to respond. This is a tricky topic as we attempt to do some magic under the covers to make sure things "just work" in the default case of passing an endpoint reference or passing a connection string via WithReference.
When you get an
EndpointReference(viaresource.GetEndpoint), it has no idea what the URL is or is going to be until the app host starts up. That's why you see exceptions about the endpoint not being allocated when you try to resolve the Url during startup. This is why there's an environment variable callback. It will run after the endpoints have been allocated and you can access various properties.When we detect a container to host reference when r…