Search in sources :

Example 1 with DefaultBuilder

use of com.microsoft.windowsazure.core.DefaultBuilder in project crate by crate.

the class AzureComputeServiceImpl method createConfiguration.

private Configuration createConfiguration() {
    Configuration conf = null;
    try {
        AuthenticationResult authRes = AuthHelper.getAccessTokenFromServicePrincipalCredentials(Azure.ENDPOINT, Azure.AUTH_ENDPOINT, tenantId, appId, appSecret);
        DefaultBuilder registry = DefaultBuilder.create();
        AzureConfiguration.registerServices(registry);
        conf = ManagementConfiguration.configure(null, new Configuration(registry), URI.create(Azure.ENDPOINT), subscriptionId, authRes.getAccessToken());
    } catch (Exception e) {
        LOGGER.error("Could not create configuration for Azure clients", e);
    }
    return conf;
}
Also used : ManagementConfiguration(com.microsoft.windowsazure.management.configuration.ManagementConfiguration) Configuration(com.microsoft.windowsazure.Configuration) AzureConfiguration(io.crate.azure.AzureConfiguration) DefaultBuilder(com.microsoft.windowsazure.core.DefaultBuilder) ElasticsearchException(org.elasticsearch.ElasticsearchException) IOException(java.io.IOException) AuthenticationResult(com.microsoft.aad.adal4j.AuthenticationResult)

Aggregations

AuthenticationResult (com.microsoft.aad.adal4j.AuthenticationResult)1 Configuration (com.microsoft.windowsazure.Configuration)1 DefaultBuilder (com.microsoft.windowsazure.core.DefaultBuilder)1 ManagementConfiguration (com.microsoft.windowsazure.management.configuration.ManagementConfiguration)1 AzureConfiguration (io.crate.azure.AzureConfiguration)1 IOException (java.io.IOException)1 ElasticsearchException (org.elasticsearch.ElasticsearchException)1