你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

AzurePipelinesCredential Class

  • java.lang.Object
    • com.azure.identity.AzurePipelinesCredential

Implements

public class AzurePipelinesCredential
implements TokenCredential

The AzurePipelinesCredential acquires a token using the Azure Pipelines service connection. To construct an instance of this credential, use the AzurePipelinesCredentialBuilder:

// serviceConnectionId is retrieved from the portal.
 // systemAccessToken is retrieved from the pipeline environment as shown.
 // You may choose another name for this variable.

 String systemAccessToken = System.getenv("SYSTEM_ACCESSTOKEN");
 AzurePipelinesCredential credential = new AzurePipelinesCredentialBuilder().clientId(clientId)
     .tenantId(tenantId)
     .serviceConnectionId(serviceConnectionId)
     .systemAccessToken(systemAccessToken)
     .build();

Method Summary

Modifier and Type Method and Description
Mono<AccessToken> getToken(TokenRequestContext request)
AccessToken getTokenSync(TokenRequestContext request)

Methods inherited from java.lang.Object

Method Details

getToken

public Mono getToken(TokenRequestContext request)

Parameters:

request

getTokenSync

public AccessToken getTokenSync(TokenRequestContext request)

Parameters:

request

Applies to