use of com.azure.core.management.profile.AzureProfile in project terra-workspace-manager by DataBiosphere.
the class CrlService method buildRelayManager.
private RelayManager buildRelayManager(AzureCloudContext azureCloudContext, AzureConfiguration azureConfig) {
TokenCredential azureCreds = getManagedAppCredentials(azureConfig);
AzureProfile azureProfile = new AzureProfile(azureCloudContext.getAzureTenantId(), azureCloudContext.getAzureSubscriptionId(), AzureEnvironment.AZURE);
// We must use FQDN because there are two `Defaults` symbols imported otherwise.
RelayManager manager = bio.terra.cloudres.azure.resourcemanager.relay.Defaults.crlConfigure(clientConfig, RelayManager.configure()).authenticate(azureCreds, azureProfile);
return manager;
}
use of com.azure.core.management.profile.AzureProfile in project terra-workspace-manager by DataBiosphere.
the class CrlService method buildComputeManager.
private ComputeManager buildComputeManager(AzureCloudContext azureCloudContext, AzureConfiguration azureConfig) {
TokenCredential azureCreds = getManagedAppCredentials(azureConfig);
AzureProfile azureProfile = new AzureProfile(azureCloudContext.getAzureTenantId(), azureCloudContext.getAzureSubscriptionId(), AzureEnvironment.AZURE);
// We must use FQDN because there are two `Defaults` symbols imported otherwise.
ComputeManager manager = bio.terra.cloudres.azure.resourcemanager.common.Defaults.crlConfigure(clientConfig, ComputeManager.configure()).authenticate(azureCreds, azureProfile);
return manager;
}
use of com.azure.core.management.profile.AzureProfile in project terra-workspace-manager by DataBiosphere.
the class CrlService method buildResourceManager.
/**
* Get a resource manager pointed at the MRG subscription
*
* @param azureCloudContext target cloud context
* @return azure resource manager
*/
public ResourceManager buildResourceManager(AzureCloudContext azureCloudContext, AzureConfiguration azureConfig) {
TokenCredential azureCreds = getManagedAppCredentials(azureConfig);
AzureProfile azureProfile = new AzureProfile(azureCloudContext.getAzureTenantId(), azureCloudContext.getAzureSubscriptionId(), AzureEnvironment.AZURE);
// We must use FQDN because there are two `Defaults` symbols imported otherwise.
ResourceManager manager = bio.terra.cloudres.azure.resourcemanager.common.Defaults.crlConfigure(clientConfig, ResourceManager.configure()).authenticate(azureCreds, azureProfile).withSubscription(azureCloudContext.getAzureSubscriptionId());
return manager;
}
use of com.azure.core.management.profile.AzureProfile in project azure-maven-plugins by microsoft.
the class RedisManagerFactory method create.
@Cacheable(cacheName = "RedisManager", key = "$subscriptionId")
public static RedisManager create(String subscriptionId) {
final Account account = Azure.az(AzureAccount.class).account();
final AzureConfiguration config = Azure.az().config();
final String userAgent = config.getUserAgent();
final HttpLogDetailLevel logLevel = Optional.ofNullable(config.getLogLevel()).map(HttpLogDetailLevel::valueOf).orElse(HttpLogDetailLevel.NONE);
final AzureProfile azureProfile = new AzureProfile(null, subscriptionId, account.getEnvironment());
return RedisManager.configure().withHttpClient(AzureService.getDefaultHttpClient()).withLogLevel(logLevel).withPolicy(getUserAgentPolicy(userAgent)).authenticate(account.getTokenCredential(subscriptionId), azureProfile);
}
use of com.azure.core.management.profile.AzureProfile in project azure-maven-plugins by microsoft.
the class MySqlManagerFactory method create.
@Cacheable(cacheName = "MySqlManager", key = "$subscriptionId")
public static MySqlManager create(String subscriptionId) {
final Account account = Azure.az(AzureAccount.class).account();
final AzureConfiguration config = Azure.az().config();
final String userAgent = config.getUserAgent();
final HttpLogDetailLevel logLevel = Optional.ofNullable(config.getLogLevel()).map(HttpLogDetailLevel::valueOf).orElse(HttpLogDetailLevel.NONE);
final AzureProfile azureProfile = new AzureProfile(null, subscriptionId, account.getEnvironment());
return MySqlManager.configure().withHttpClient(AzureService.getDefaultHttpClient()).withLogOptions(new HttpLogOptions().setLogLevel(logLevel)).withPolicy(getUserAgentPolicy(userAgent)).authenticate(account.getTokenCredential(subscriptionId), azureProfile);
}
Aggregations