AzurePipelinesEnvironmentInfo.

BuildDefinition Property

Summary

Gets Azure Pipelines Build Definition information.

Syntax

public AzurePipelinesDefinitionInfo BuildDefinition { get; }

Examples

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

Value

Type Description
AzurePipelinesDefinitionInfo The Azure Pipelines Build Definition.