ResourceExtensions.ProcessEnvironmentVariableValuesAsync 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.
Processes environment variable values for the specified resource within the given execution context.
public static System.Threading.Tasks.ValueTask ProcessEnvironmentVariableValuesAsync(this Aspire.Hosting.ApplicationModel.IResource resource, Aspire.Hosting.DistributedApplicationExecutionContext executionContext, Action<string,object?,string?,Exception?> processValue, Microsoft.Extensions.Logging.ILogger logger, string? containerHostName = default, System.Threading.CancellationToken cancellationToken = default);
static member ProcessEnvironmentVariableValuesAsync : Aspire.Hosting.ApplicationModel.IResource * Aspire.Hosting.DistributedApplicationExecutionContext * Action<string, obj, string, Exception> * Microsoft.Extensions.Logging.ILogger * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
<Extension()>
Public Function ProcessEnvironmentVariableValuesAsync (resource As IResource, executionContext As DistributedApplicationExecutionContext, processValue As Action(Of String, Object, String, Exception), logger As ILogger, Optional containerHostName As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask
Parameters
- resource
- IResource
The resource from which the environment variables are retrieved and processed.
- executionContext
- DistributedApplicationExecutionContext
The execution context to be used for processing the environment variables.
An action delegate invoked for each environment variable, providing the key, the unprocessed value, the processed value (if available), and any exception encountered during processing.
- logger
- ILogger
The logger used to log any information or errors during the environment variables processing.
- containerHostName
- String
The optional container host name associated with the resource being processed.
- cancellationToken
- CancellationToken
A cancellation token to observe during the asynchronous operation.
Returns
A task that represents the asynchronous operation.