use of com.microsoft.azure.management.Azure in project flink by apache.
the class AzureFileSystemBehaviorITCase method isHttpsTrafficOnly.
private static boolean isHttpsTrafficOnly() throws IOException {
if (StringUtils.isNullOrWhitespaceOnly(RESOURCE_GROUP) || StringUtils.isNullOrWhitespaceOnly(TOKEN_CREDENTIALS_FILE)) {
// default to https only, as some fields are missing
return true;
}
Assume.assumeTrue("Azure storage account not configured, skipping test...", !StringUtils.isNullOrWhitespaceOnly(ACCOUNT));
AzureTokenCredentials credentials = ApplicationTokenCredentials.fromFile(new File(TOKEN_CREDENTIALS_FILE));
Azure azure = StringUtils.isNullOrWhitespaceOnly(SUBSCRIPTION_ID) ? Azure.authenticate(credentials).withDefaultSubscription() : Azure.authenticate(credentials).withSubscription(SUBSCRIPTION_ID);
return azure.storageAccounts().getByResourceGroup(RESOURCE_GROUP, ACCOUNT).inner().enableHttpsTrafficOnly();
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class CreateVirtualMachinesUsingCustomImageOrSpecializedVHD method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BASIC).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class ManageWebAppStorageAccountConnection method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BASIC).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class CreateVirtualMachineUsingSpecializedDiskFromSnapshot method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BODY).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
use of com.microsoft.azure.management.Azure in project azure-sdk-for-java by Azure.
the class CreateVirtualMachineUsingSpecializedDiskFromVhd method main.
/**
* Main entry point.
* @param args the parameters
*/
public static void main(String[] args) {
try {
//=============================================================
// Authenticate
final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
Azure azure = Azure.configure().withLogLevel(LogLevel.BODY).authenticate(credFile).withDefaultSubscription();
// Print selected subscription
System.out.println("Selected subscription: " + azure.subscriptionId());
runSample(azure);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
Aggregations