DistributedApplicationHostingTestingExtensions.GetConnectionStringAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the connection string for the specified resource.
public static System.Threading.Tasks.ValueTask<string?> GetConnectionStringAsync (this Aspire.Hosting.DistributedApplication app, string resourceName, System.Threading.CancellationToken cancellationToken = default);
static member GetConnectionStringAsync : Aspire.Hosting.DistributedApplication * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<string>
<Extension()>
Public Function GetConnectionStringAsync (app As DistributedApplication, resourceName As String, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of String)
Parameters
The application.
- resourceName
- String
The resource name.
- cancellationToken
- CancellationToken
Returns
The connection string for the specified resource.
Exceptions
The resource was not found or does not expose a connection string.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for