@Beta public final class AzureCliCredentials extends AzureTokenCredentials
| Modifier and Type | Method and Description |
|---|---|
String |
clientId() |
static AzureCliCredentials |
create()
Creates an instance of AzureCliCredentials with the default Azure CLI configuration.
|
static AzureCliCredentials |
create(File azureProfile,
File accessTokens)
Creates an instance of AzureCliCredentials with custom locations of the token files.
|
String |
domain()
Override this method to provide the domain or tenant ID the token is valid in.
|
AzureEnvironment |
environment() |
String |
getToken(String resource)
Override this method to provide the mechanism to get a token.
|
applyCredentialsFilter, defaultSubscriptionId, getToken, proxy, withDefaultSubscriptionId, withProxygetSchemepublic static AzureCliCredentials create() throws IOException
IOException - if the Azure CLI token files are not accessiblepublic static AzureCliCredentials create(File azureProfile, File accessTokens) throws IOException
azureProfile - the azureProfile.json file created by Azure CLIaccessTokens - the accessTokens.json file created by Azure CLIIOException - if the Azure CLI token files are not accessiblepublic String clientId()
public String domain()
AzureTokenCredentialsdomain in class AzureTokenCredentialspublic AzureEnvironment environment()
environment in class AzureTokenCredentialspublic String getToken(String resource) throws IOException
AzureTokenCredentialsgetToken in class AzureTokenCredentialsresource - the resource the access token is forIOException - exceptions from IOCopyright © 2019. All rights reserved.