-
Notifications
You must be signed in to change notification settings - Fork 609
Update health check to ensure blob containers created at right time #9159
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
base: main
Are you sure you want to change the base?
Conversation
Hmm, we had this debate when @sebastienros did the database creation and I thought we decided to use the ResourceReady event (which runs after health checks). |
For databases, do we: aspire/src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs Lines 58 to 77 in 88ff939
aspire/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs Lines 66 to 90 in 88ff939
In general, I dislike using health checks to mutate state. They should just be used to check health, not make something "healthy". |
I am not super fond of this result, but I couldn't find a way to add a healthcheck for individual blob containers. Any suggestions? |
I don't think we do healthchecks for child resources anywhere else. For example, CosmosDB seems to honly have it for the whole service. aspire/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs Lines 104 to 122 in e3d170c
Because the I think we should be able to follow the existing patterns in Sql, Postgres, and in Azure CosmosDB. What doesn't work about the existing pattern? Any other suggestions here @sebastienros or @mitchdenny ? |
SqlServer/Postgres databases have one. It's done by using their own connection string which has the |
Resolves #9139
Resolves #9145
I removed
ResourceReadyEvent
handler, and moved blob container creation logic into the BlobStorage health check. This way, once we connected to the storage emulator and have the service client, we can ensure the requested blob containers are created.Kudos to @mitchdenny for giving me some ideas.