@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() |
AzureEnvironment |
environment() |
String |
getToken(String resource) |
applyCredentialsFilter, defaultSubscriptionId, getToken, proxy, sslSocketFactory, withDefaultSubscriptionId, withProxy, withSslSocketFactory
public 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()
domain
in class AzureTokenCredentials
public AzureEnvironment environment()
environment
in class AzureTokenCredentials
public String getToken(String resource) throws IOException
getToken
in class AzureTokenCredentials
IOException
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/