You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update health check to ensure blob containers created at right time (#9159)
* Update health check to ensure blob containers created at right time
Resolves#9139Resolves#9145
* fixup! Update health check to ensure blob containers created at right time
* fixup! Update health check to ensure blob containers created at right time
* fixup! Update health check to ensure blob containers created at right time
* Prevent multiple container checks
* Use better variable name
* Move container creation to RunAsEmulator
* Register single hc for blobs
* Reuse blobserviceclient
* Fix registrations
* Remove custom heathcheck
* Remove custom healthcheck
* Remove specific health checks
* Add blob and container health checks
* Fix test
* Feedback
* Improve comment
---------
Co-authored-by: Sebastien Ros <sebastienros@gmail.com>
thrownewDistributedApplicationException($"BeforeResourceStartedEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
141
-
}
137
+
// The BlobServiceClient is created before the health check is run.
138
+
// We can't use ConnectionStringAvailableEvent here because the resource doesn't have a connection string, so
139
+
// we use BeforeResourceStartedEvent
142
140
141
+
varconnectionString=awaitbuilder.Resource.GetBlobConnectionString().GetValueAsync(ct).ConfigureAwait(false)??thrownewDistributedApplicationException($"{nameof(ConnectionStringAvailableEvent)} was published for the '{builder.Resource.Name}' resource but the connection string was null.");
thrownewDistributedApplicationException($"ResourceReadyEvent was published for the '{builder.Resource.Name}' resource but the connection string was null.");
152
+
thrownewInvalidOperationException("BlobServiceClient is not initialized.");
Copy file name to clipboardExpand all lines: src/Components/Aspire.Azure.Storage.Blobs/AspireBlobStorageExtensions.BlobStorageContainerComponent.AzureBlobStorageContainerHealthCheck.cs
0 commit comments