use of com.microsoft.azuretools.sdkmanage.IdentityAzureManager in project azure-tools-for-java by Microsoft.
the class AzureLoginHelper method ensureAzureSubsAvailable.
public static void ensureAzureSubsAvailable() throws AzureExecutionException {
if (!AuthMethodManager.getInstance().isSignedIn()) {
throw new AzureExecutionException(NEED_SIGN_IN);
}
IdentityAzureManager azureManager = IdentityAzureManager.getInstance();
final List<Subscription> subscriptions = azureManager.getSubscriptions();
if (CollectionUtils.isEmpty(subscriptions)) {
throw new AzureExecutionException(NO_SUBSCRIPTION);
}
final List<Subscription> selectedSubscriptions = azureManager.getSelectedSubscriptions();
if (CollectionUtils.isEmpty(selectedSubscriptions)) {
throw new AzureExecutionException(MUST_SELECT_SUBSCRIPTION);
}
}
use of com.microsoft.azuretools.sdkmanage.IdentityAzureManager in project azure-tools-for-java by Microsoft.
the class SignInCommandHandler method ensureAzureSubsAvailable.
private static void ensureAzureSubsAvailable() throws AzureExecutionException {
if (!AuthMethodManager.getInstance().isSignedIn()) {
throw new AzureExecutionException(NEED_SIGN_IN);
}
IdentityAzureManager azureManager = IdentityAzureManager.getInstance();
final List<Subscription> subscriptions = azureManager.getSubscriptions();
if (CollectionUtils.isEmpty(subscriptions)) {
throw new AzureExecutionException(NO_SUBSCRIPTION);
}
final List<Subscription> selectedSubscriptions = azureManager.getSelectedSubscriptions();
if (CollectionUtils.isEmpty(selectedSubscriptions)) {
throw new AzureExecutionException(MUST_SELECT_SUBSCRIPTION);
}
}
Aggregations