AzurePipelinesEnvironmentInfo.

Agent Property

Summary

Gets Azure Pipelines agent information.

Syntax

public AzurePipelinesAgentInfo Agent { get; }

Examples

if (BuildSystem.AzurePipelines.IsRunningOnAzurePipelines)
{
    Information(
        @"Agent:
        Id: {0}
        Name: {1}",
        BuildSystem.AzurePipelines.Environment.Agent.Id,
        BuildSystem.AzurePipelines.Environment.Agent.Name
        );
}
else
{
    Information("Not running on Azure Pipelines");
}
if (AzurePipelines.IsRunningOnAzurePipelines)
{
    Information(
        @"Agent:
        Id: {0}
        Name: {1}",
        AzurePipelines.Environment.Agent.Id,
        AzurePipelines.Environment.Agent.Name
        );
}
else
{
    Information("Not running on Azure Pipelines");
}

Value

Type Description
AzurePipelinesAgentInfo The Azure Pipelines agent.