PipelineContext Properties
ClassProperties7 members
Provides contextual information and services for the pipeline execution process of a distributed application.
Gets the cancellation token for the pipeline operation.
public CancellationToken CancellationToken { get; set; } Gets the execution context for the distributed application.
public DistributedApplicationExecutionContext ExecutionContext { get; } Gets the logger for pipeline operations.
public ILogger Logger { get; } Gets the distributed application model to be deployed.
public DistributedApplicationModel Model { get; } Gets the resolved steps selected for this execution, including transitive dependencies.
public IReadOnlyList<PipelineStep> SelectedSteps { get; }Remarks
This list is populated before step actions execute. It is empty before pipeline execution. Unlike the application model, it excludes steps outside the selected target's dependency graph.
Examples
builder.Pipeline.AddStep("inspect-deployment", context =>{ foreach (var step in context.PipelineContext.SelectedSteps) { context.Logger.LogInformation("Selected step: {StepName}", step.Name); } return Task.CompletedTask;}, requiredBy: WellKnownPipelineSteps.Deploy); Gets the service provider for dependency resolution.
public IServiceProvider Services { get; } Gets the pipeline summary that steps can add information to. The summary will be displayed to users after pipeline execution completes.
public PipelineSummary Summary { get; }Remarks
Pipeline steps can add key-value pairs to the summary to provide useful information about the pipeline execution, such as deployment targets, resource names, URLs, etc.
Examples
// In a pipeline stepcontext.PipelineContext.Summary.Add("☁️ Target", "Azure");context.PipelineContext.Summary.Add("📦 Resource Group", "rg-myapp");