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