Class AzurePipelinesCredential

java.lang.Object
com.azure.identity.AzurePipelinesCredential
All Implemented Interfaces:
com.azure.core.credential.TokenCredential

public class AzurePipelinesCredential extends Object implements com.azure.core.credential.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 Details

    • getToken

      public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request)
      Specified by:
      getToken in interface com.azure.core.credential.TokenCredential
    • getTokenSync

      public com.azure.core.credential.AccessToken getTokenSync(com.azure.core.credential.TokenRequestContext request)
      Specified by:
      getTokenSync in interface com.azure.core.credential.TokenCredential