-
Hello everyone. On the project I am working I need to start a container which is depended on other underlying containers to start first. The container I need to run is Kernel Memory. This container needs an appsettings.json file on startup. It needs to have the connection strings for the Blob Container. I had an issue obtaining them but I got help in this issue: #5115 Now I fill my appsettings the moment that the connection string is available for my storage emulator using a lifehook.
Though this still does not solve my problem. I need to start the container only when the appsettings is correctly filled, what would be the best way to delay it's start? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
We have this resource eventing model https://learn.microsoft.com/en-us/dotnet/aspire/app-host/eventing#resource-eventing, that lets you block before a resource starts so you can implement custom waiting like this. You can also use container files (new feature): PS: Here's a big doc on the resource model https://gist.github.com/davidfowl/b408af870d4b5b54a28bf18bffa127e1. It explains some of these primitives. |
Beta Was this translation helpful? Give feedback.
-
I like this. Is there a way to have a dependent resource then WaitFor the EventingResource? scenario is I have an API service. I want to generate a ClientSecret for my dependent consumer. I can wait for the API service to be ready using the above scenario. Ideally, I'd like to do the following: string dependentServiceClientId = "dependentClient"; var myDependentService = builder.AddProject<Projects.My_Dependent_Project>("dependentProject") |
Beta Was this translation helpful? Give feedback.
We have this resource eventing model https://learn.microsoft.com/en-us/dotnet/aspire/app-host/eventing#resource-eventing, that lets you block before a resource starts so you can implement custom waiting like this.
You can also use container files (new feature):
aspire/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs
Line 204 in e1b74bf
PS: Here's a big doc on the resource model https://gist.github.com/davidfowl/b408af870d4b5b54a28bf18bffa127e1. It explains some of these primitives.