Closed v-cazhang closed 8 months ago
Did F5 work successfully? I suspect that the VaultUri was not set correctly during deployment. Closing this in favor of https://github.com/dotnet/aspire/issues/2621 where I've added a lot more details. We can revisit this issue in our sync if you think that this is a different issue.
Hi @balachir , for this issue, I also try to use the key vault created by VS, and F5 can work successfully this time. But publish still reproduces this issue.
@v-cazhang you mention that publish still has issue. Does the publish issue still reproduce using Aspire P5? If yes, can you open a new issue using Aspire P4 / Aspire P5 in the repro steps and add it to our Issues Summary page so that we can track.
REGRESSION INFO: Also repro on 8.0.0-preview.3.24105.21
INSTALL STEPS
REPRO STEPS
New Project > ASP.NET Core Empty project > name it 'AspireKeyVault'> 8.0 > check 'Enlist in Aspire Orchestration'
Right-click AspireKeyVault project > Add > Aspire component > Aspire.Azure.Security.KeyVault
Update the Program.cs of AspireKeyVault project with following codes:
string? _mySecret = builder.Configuration["myAppSetting"]; var result = string.IsNullOrEmpty(_mySecret) ? "Null" : _mySecret; app.MapGet("/", async context => { await context.Response.WriteAsync($"Secret is {result}"); });
Right-click the AspireKeyVault.AppHost > Publish > Azure Container Apps for .NET Aspire > next
Under 'AzDev Environment', select following settings > next
Under 'Aspire Services', check AspireKeyVault, click 'Finish' > 'Close'
Click 'Publish' button on the summary page.
After publish finished, open 'Resource group', click AspireKeyVault
Notes:
ACTUAL Open AspireKeyVault container app shows 'ContainerCrashing'. Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'uriString') at System.ArgumentNullException.Throw(String paramName) at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName) at System.Uri..ctor(String uriString) at Program.$(String[] args) in C:\Users\v-cazhang\source\repos\AspireKeyVault\AspireKeyVault\Program.cs:line 6
EXPECTED Doesn't show container crashing error.