CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-azure--azure-identity

The Azure Identity library provides Microsoft Entra ID token authentication support across the Azure SDK with a comprehensive set of TokenCredential implementations.

Pending
Overview
Eval results
Files

environment-credential.mddocs/

Environment Credential

Authenticates using environment variables for service principal credentials, supporting both client secret and client certificate authentication.

Capabilities

Environment Variable Authentication

Reads credential information from environment variables to authenticate service principals.

/**
 * Authenticates using environment variables for service principal credentials
 */
class EnvironmentCredential implements TokenCredential {
    Mono<AccessToken> getToken(TokenRequestContext request);
    AccessToken getTokenSync(TokenRequestContext request);
}

class EnvironmentCredentialBuilder extends CredentialBuilderBase<EnvironmentCredentialBuilder> {
    EnvironmentCredentialBuilder authorityHost(String authorityHost);
    EnvironmentCredentialBuilder executorService(ExecutorService executorService);
    EnvironmentCredential build();
}

Supported Environment Variables:

For Client Secret Authentication:

  • AZURE_CLIENT_ID - The application (client) ID
  • AZURE_CLIENT_SECRET - The client secret
  • AZURE_TENANT_ID - The tenant ID
  • AZURE_AUTHORITY_HOST (optional) - The authority host URL

For Client Certificate Authentication:

  • AZURE_CLIENT_ID - The application (client) ID
  • AZURE_CLIENT_CERTIFICATE_PATH - Path to PEM or PFX certificate file
  • AZURE_CLIENT_CERTIFICATE_PASSWORD - Certificate password (if required)
  • AZURE_TENANT_ID - The tenant ID
  • AZURE_AUTHORITY_HOST (optional) - The authority host URL

Usage Examples:

import com.azure.identity.EnvironmentCredential;
import com.azure.identity.EnvironmentCredentialBuilder;

// Create credential using environment variables
TokenCredential credential = new EnvironmentCredentialBuilder()
    .build();

// Use with Azure SDK clients
SecretClient client = new SecretClientBuilder()
    .vaultUrl("https://myvault.vault.azure.net/")
    .credential(credential)
    .buildClient();

Exception Handling

Throws CredentialUnavailableException when required environment variables are not set or invalid.

Install with Tessl CLI

npx tessl i tessl/maven-com-azure--azure-identity

docs

advanced-authentication-flows.md

authorization-code-authentication.md

azure-developer-cli-authentication.md

azure-pipelines-authentication.md

client-assertion-authentication.md

configuration-and-utilities.md

credential-chaining.md

default-azure-credential.md

developer-tool-credentials.md

environment-credential.md

index.md

interactive-user-authentication.md

managed-identity-credential.md

service-principal-authentication.md

shared-token-cache-authentication.md

username-password-authentication.md

visual-studio-code-authentication.md

tile.json