Share via


ResourceExtensions.ProcessEnvironmentVariableValuesAsync Method

Definition

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.

processValue
Action<String,Object,String,Exception>

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.

Applies to