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;
}
Aggregations