-
Notifications
You must be signed in to change notification settings - Fork 732
WaitFor for Azure Storage #5761
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9c3baad
WaitFor for Azure Storage
mitchdenny f630e36
Enable health checks on blobs resource.
mitchdenny a603507
Add Queues health check.
mitchdenny 7d22f6d
Add queues logic to playground app.
mitchdenny 9951e5d
Merge branch 'main' into mitchdenny/waitfor-azure-storage
mitchdenny 979a6b2
Basic working model.
mitchdenny 20d907f
Revise test
mitchdenny 43b5198
Update Program.cs
mitchdenny 4dceb99
Address race.
mitchdenny eb72800
Merge branch 'main' into mitchdenny/waitfor-azure-storage
mitchdenny 3ccff4a
Switched over to propogating an internal event.
mitchdenny 041dad7
Update src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs
mitchdenny 95e8609
Merge branch 'main' into mitchdenny/waitfor-azure-storage
mitchdenny ddb1855
Change Storage and Cosmos so that health checks are only enabled when…
mitchdenny a341961
Merge branch 'mitchdenny/waitfor-azure-storage' of https://github.com…
mitchdenny 968bd1f
No need for locking now.
mitchdenny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1251,14 +1251,31 @@ await notificationService.PublishUpdateAsync(cr.ModelResource, s => s with | |
| } | ||
| } | ||
|
|
||
| private async Task CreateExecutableAsync(AppResource er, ILogger resourceLogger, CancellationToken cancellationToken) | ||
| private async Task PublishConnectionStringAvailableEvent(IResource resource, CancellationToken cancellationToken) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need this still?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes we still have resources that depend on it (Postgres/Redis etc). |
||
| { | ||
| if (er.ModelResource is IResourceWithConnectionString) | ||
| // If the resource itself has a connection string then publish that the connection string is available. | ||
| if (resource is IResourceWithConnectionString) | ||
| { | ||
| var connectionStringAvailableEvent = new ConnectionStringAvailableEvent(er.ModelResource, serviceProvider); | ||
| var connectionStringAvailableEvent = new ConnectionStringAvailableEvent(resource, serviceProvider); | ||
| await eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| // Sometimes the container/executable itself does not have a connection string, and in those cases | ||
| // we need to dispatch the event for the children. | ||
| if (_parentChildLookup[resource] is { } children) | ||
| { | ||
| foreach (var child in children.OfType<IResourceWithConnectionString>()) | ||
| { | ||
| var childConnectionStringAvailableEvent = new ConnectionStringAvailableEvent(child, serviceProvider); | ||
| await eventing.PublishAsync(childConnectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private async Task CreateExecutableAsync(AppResource er, ILogger resourceLogger, CancellationToken cancellationToken) | ||
| { | ||
| await PublishConnectionStringAvailableEvent(er.ModelResource, cancellationToken).ConfigureAwait(false); | ||
|
|
||
| var beforeResourceStartedEvent = new BeforeResourceStartedEvent(er.ModelResource, serviceProvider); | ||
| await eventing.PublishAsync(beforeResourceStartedEvent, cancellationToken).ConfigureAwait(false); | ||
|
|
||
|
|
@@ -1550,11 +1567,7 @@ await notificationService.PublishUpdateAsync(cr.ModelResource, s => s with | |
|
|
||
| private async Task CreateContainerAsync(AppResource cr, ILogger resourceLogger, CancellationToken cancellationToken) | ||
| { | ||
| if (cr.ModelResource is IResourceWithConnectionString) | ||
| { | ||
| var connectionStringAvailableEvent = new ConnectionStringAvailableEvent(cr.ModelResource, serviceProvider); | ||
| await eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); | ||
| } | ||
| await PublishConnectionStringAvailableEvent(cr.ModelResource, cancellationToken).ConfigureAwait(false); | ||
|
|
||
| var beforeResourceStartedEvent = new BeforeResourceStartedEvent(cr.ModelResource, serviceProvider); | ||
| await eventing.PublishAsync(beforeResourceStartedEvent, cancellationToken).ConfigureAwait(false); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.