Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebToolsE2E][Aspire]After adding Azure Key Vault to AppHost project, F5 failed with exception: One or more errors occurred. (No output for vaultUri) #2674

Closed
v-cazhang opened this issue Mar 6, 2024 · 6 comments
Assignees
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Milestone

Comments

@v-cazhang
Copy link

REGRESSION INFO: Works fine on Aspire 8.0.0-preview.3.24105.21

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install 17.10.0 Preview 2.0 [34701.141.d17.10] (Includes Aspire 8.0.0-preview.4.24129.7)
  3. Apply NuGet Feeds
  4. Install Docker Desktop

REPRO STEPS

  1. New Project > ASP.NET Core Empty project > name it AspireKeyVault02 > .NET 8.0 > check 'Enlist in Aspire Orchestration' > create
  2. Open appsettings.json of AppHost project, add connection string:
"ConnectionStrings": {
  "secretConnectionName": "https://<vault_account_name>.vault.azure.net/"
}
  1. In your AppHost project, install the Aspire Azure Hosting package and save the file
  2. Open Program.cs of AspireKeyVault02.AppHost project, add following codes:
	var keyVault = builder.AddAzureKeyVault("[secretConnectionName]");
        var myService = builder.AddProject<Projects.AspireKeyVault02>("aspirekeyvault02")
                       .WithReference(keyVault);
  1. Build and F5

ACTUAL
It shows an exception during F5
image
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred. (No output for vaultUri)
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run()
at Program.

$(String[] args) in C:\Users\v-cazhang\source\repos\WebApplication2\WebApplication2.AppHost\Program.cs:line 11

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
InvalidOperationException: No output for vaultUri

EXPECTED
F5 successfully.
image

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 6, 2024
@v-cazhang v-cazhang changed the title [WebToolsE2E][Aspire] [WebToolsE2E] After adding Azure Key Vault to AppHost project, F5 failed with exception: One or more errors occurred. (No output for vaultUri) [WebToolsE2E][Aspire]After adding Azure Key Vault to AppHost project, F5 failed with exception: One or more errors occurred. (No output for vaultUri) Mar 6, 2024
@balachir balachir added area-integrations Issues pertaining to Aspire Integrations packages and removed area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Mar 6, 2024
@davidfowl
Copy link
Member

This pattern no longer works for azure resources. Dupe of #2395

@balachir
Copy link

balachir commented Mar 6, 2024

@davidfowl the README file for Aspire.Azure.Security.KeyVault component recommends this builder.AddAzureKeyVault pattern in the AppHost section of the README. Will the README also get updated as part of the fix for #2395 or should we open a separate issue to fix the README for P5?

@davidfowl davidfowl reopened this Mar 6, 2024
@davidfowl
Copy link
Member

That's a good point. It applies to the application and to the app host as well, but not the AddKeyVault method. @eerhardt What do you think? Do we update the readmes to add this "use existing keyvault vs new keyvault" scenario?

@eerhardt
Copy link
Member

eerhardt commented Mar 6, 2024

If the READMEs no longer point to valid information/scenarios we need to update them. What is the recommended pattern here for someone who isn't using AzureProvisioning? (or do we start recommend using AzureProvisioning in the READMEs?)

@davidfowl
Copy link
Member

This: #2395 (comment)

@eerhardt eerhardt added area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-integrations Issues pertaining to Aspire Integrations packages and removed area-integrations Issues pertaining to Aspire Integrations packages area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Apr 15, 2024
@eerhardt eerhardt added this to the GA milestone Apr 15, 2024
@eerhardt
Copy link
Member

This has been completed with #3793.

@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Projects
None yet
Development

No branches or pull requests

6 participants