Skip to content

"System.InvalidOperationException: The endpoint http is not allocated for the resource keycloak-webrtc." generating manifest #7051

Answered by davidfowl
paulomorgado asked this question in Q&A
Discussion options

You must be logged in to vote

Read this:

dotnet/docs-aspire#2340 (comment)

This line of code:

var baseAddress = await idp.Resource.ConnectionStringExpression.GetValueAsync(default);

Only works when running. There's no value for the connection string when you are in publish mode.

You want to use a ReferenceExpression to defer the evaluation and generate the right format in either mode.

.WithEnvironment(async ctx =>
        {
            var baseAddress = idp.Resource.ConnectionStringExpression;
            ctx.EnvironmentVariables["Authentication__JwtBearerOptions__Authority"] = baseAddress;
            ctx.EnvironmentVariables["Authentication__JwtBearerOptions__Configuration__Issuer"] = $"{baseAddress}";
            ctx

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paulomorgado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants