AzureDevOpsAliases.

AzureDevOpsBuildUsingAzurePipelinesOAuthToken(ICakeContext, int, bool) Method

Summary

Gets the description of a specific build which is running the access token provided by Azure Pipelines. Make sure the build has the 'Allow Scripts to access OAuth token' option enabled.
Assembly
Cake.AzureDevOps.dll
Namespace
Cake.AzureDevOps
Containing Type
AzureDevOpsAliases

Syntax

public static AzureDevOpsBuild AzureDevOpsBuildUsingAzurePipelinesOAuthToken(this ICakeContext context, int buildId, bool throwExceptionIfBuildCouldNotBeFound)

Examples

Get an Azure Pipelines build. Don't throw exception in case the build is not found:

var build =
    AzureDevOpsBuildUsingAzurePipelinesOAuthToken(42, false);

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute
CakeNamespaceImportAttribute

Parameters

Name Type Description
context ICakeContext The context.
buildId int ID of the build.
throwExceptionIfBuildCouldNotBeFound bool Value indicating whether an exception should be thrown if build could not be found.

Return Value

Type Description
AzureDevOpsBuild Description of the build. Returns null if build could not be found and throwExceptionIfBuildCouldNotBeFound is set to false.