Azure Management Libraries for Java
Java Other
Permalink
Failed to load latest commit information.
azure-batch [release] Prepare for beta6 development iteration Feb 8, 2017
azure-keyvault-core [#1322] Upgrade guava to 20.0 Feb 14, 2017
azure-keyvault-cryptography [release] Prepare for beta6 development iteration Feb 8, 2017
azure-keyvault-extensions [#1322] Upgrade guava to 20.0 Feb 14, 2017
azure-keyvault-webkey [#1322] Upgrade guava to 20.0 Feb 14, 2017
azure-keyvault Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-appservice Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-batch Regenrated Batch from swagger Feb 21, 2017
azure-mgmt-cdn Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-compute Virtual machine disk encryption (#1466) Feb 21, 2017
azure-mgmt-datalake-analytics Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-datalake-store Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-dns Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-graph-rbac Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-keyvault Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-network Merge pull request #1462 from jianghaolu/servicefuture Feb 15, 2017
azure-mgmt-redis Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-resources Added an interface InnerSupportsListing in core for auto generated code Feb 16, 2017
azure-mgmt-search Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-sql Regenerated SQL with new autorest Feb 21, 2017
azure-mgmt-storage Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-mgmt-trafficmanager Rename ServiceCall to ServiceFuture Feb 15, 2017
azure-samples Virtual machine disk encryption (#1466) Feb 21, 2017
azure exposing Subnet.getNetworkInterfaceIPConfigurations() and .networkInt… Feb 15, 2017
notes Migrating from beta4.1 to beta5 Feb 7, 2017
tools Fixed license headers, also fixed checkstyle for the travis build whi… Feb 8, 2017
.gitignore Moving translation.properties from Microsoft/java-to-csharp-api-gener… Dec 7, 2016
.travis.yml Also checkstyle Feb 11, 2017
AUTH.md Update AUTH.md with new Azure CLI command Dec 21, 2016
CONTRIBUTING.md Remove codegen info in contributing guide Mar 29, 2016
ChangeLog.txt Update change log for 1.0.0-beta1 Mar 3, 2016
LICENSE.txt Fix license to MIT Mar 3, 2016
README.md beta 5 readme Feb 7, 2017
appveyor.yml update appveyor.yml: use && Aug 19, 2016
gulpfile.js Update gulpfile to use new AutoRest Feb 21, 2017
my.azureauth.txt.enc Modified auth file (#1415) Jan 28, 2017
package.json Add gulp file for easy code regeneration Nov 12, 2015
pom.xml Use rc of runtime Feb 15, 2017
translation.properties Done changes as per review comments from Asir Jan 5, 2017

README.md

Build Status

Azure Management Libraries for Java

This README is based on the latest released preview version (1.0 beta 5). If you are looking for other releases, see More Information

The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources.

1.0 beta 5 is a developer preview that supports major parts of:

  • Azure Virtual Machines and VM Extensions
  • Virtual Machine Scale Sets
  • Managed Disks
  • Storage
  • Networking (virtual networks, subnets, network interfaces, IP addresses, network security groups, load balancers, DNS, traffic managers and application gateways)
  • Resource Manager
  • SQL Database (databases, firewalls and elastic pools)
  • App Service (Web Apps)
  • Key Vault, Redis, CDN and Batch.

The next preview version of the Azure Management Libraries for Java is a work in-progress. We will be adding support for more Azure services and applying finishing touches to the API.

Azure Authentication

The Azure class is the simplest entry point for creating and interacting with Azure resources.

Azure azure = Azure.authenticate(credFile).withDefaultSubscription();

Create a Virtual Machine

You can create a virtual machine instance by using a define() … create() method chain.

System.out.println("Creating a Linux VM");

VirtualMachine linuxVM = azure.virtualMachines().define("myLinuxVM")
    .withRegion(Region.US_EAST)
    .withNewResourceGroup(rgName)
    .withNewPrimaryNetwork("10.0.0.0/28")
    .withPrimaryPrivateIpAddressDynamic()
    .withNewPrimaryPublicIpAddress("mylinuxvmdns")
    .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
    .withRootUsername("tirekicker")
    .withSsh(sshKey)
    .withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
    .create();

System.out.println("Created a Linux VM: " + linuxVM.id());

Update a Virtual Machine

You can update a virtual machine instance by using an update() … apply() method chain.

linuxVM.update()
    .withNewDataDisk(20,  lun,  CachingTypes.READ_WRITE)
    .apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using another define() … create() method chain.

 VirtualMachineScaleSet virtualMachineScaleSet = azure.virtualMachineScaleSets()
     .define(vmssName)
     .withRegion(Region.US_EAST)
     .withExistingResourceGroup(rgName)
     .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2)
     .withExistingPrimaryNetworkSubnet(network, "Front-end")
     .withPrimaryInternetFacingLoadBalancer(loadBalancer1)
     .withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2)
     .withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23)
     .withoutPrimaryInternalLoadBalancer()
     .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
     .withRootUsername(userName)
     .withSsh(sshKey)
     .withNewDataDisk(100)
     .withNewDataDisk(100, 1, CachingTypes.READ_WRITE)
     .withNewDataDisk(100, 2, CachingTypes.READ_WRITE, StorageAccountTypes.STANDARD_LRS)
     .withCapacity(3)
     .create();

Create a Network Security Group

You can create a network security group instance by using another define() … create() method chain.

NetworkSecurityGroup frontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName)
    .withRegion(Region.US_EAST)
    .withNewResourceGroup(rgName)
    .defineRule("ALLOW-SSH")
        .allowInbound()
        .fromAnyAddress()
        .fromAnyPort()
        .toAnyAddress()
        .toPort(22)
        .withProtocol(NetworkSecurityRule.Protocol.TCP)
        .withPriority(100)
        .withDescription("Allow SSH")
        .attach()
    .defineRule("ALLOW-HTTP")
        .allowInbound()
        .fromAnyAddress()
        .fromAnyPort()
        .toAnyAddress()
        .toPort(80)
        .withProtocol(NetworkSecurityRule.Protocol.TCP)
        .withPriority(101)
        .withDescription("Allow HTTP")
        .attach()
    .create();

Create an Application Gateway

You can create a application gateway instance by using another define() … create() method chain.

ApplicationGateway applicationGateway = azure.applicationGateways().define("myFirstAppGateway")
    .withRegion(Region.US_EAST)
    .withExistingResourceGroup(resourceGroup)
    // Request routing rule for HTTP from public 80 to public 8080
    .defineRequestRoutingRule("HTTP-80-to-8080")
        .fromPublicFrontend()
        .fromFrontendHttpPort(80)
        .toBackendHttpPort(8080)
        .toBackendIpAddress("11.1.1.1")
        .toBackendIpAddress("11.1.1.2")
        .toBackendIpAddress("11.1.1.3")
        .toBackendIpAddress("11.1.1.4")
        .attach()
    .withExistingPublicIpAddress(publicIpAddress)
    .create();

Create a Web App

You can create a Web App instance by using another define() … create() method chain.

WebApp webApp = azure.webApps()
    .define(appName)
    .withNewResourceGroup(rgName)
    .withNewAppServicePlan(planName)
    .withRegion(Region.US_WEST)
    .withPricingTier(AppServicePricingTier.STANDARD_S1)
    .create();

Create a SQL Database

You can create a SQL server instance by using another define() … create() method chain.

SqlServer sqlServer = azure.sqlServers().define(sqlServerName)
    .withRegion(Region.US_EAST)
    .withNewResourceGroup(rgName)
    .withAdministratorLogin("adminlogin123")
    .withAdministratorPassword("myS3cureP@ssword")
    .withNewFirewallRule("10.0.0.1")
    .withNewFirewallRule("10.2.0.1", "10.2.0.10")
    .create();

Then, you can create a SQL database instance by using another define() … create() method chain.

SqlDatabase database = sqlServer.databases().define("myNewDatabase")
    .create();

Sample Code

You can find plenty of sample code that illustrates management scenarios in Azure Virtual Machines, Virtual Machine Scale Sets, Managed Disks, Storage, Networking, Resource Manager, SQL Database, App Service (Web Apps), Key Vault, Redis, CDN and Batch …

Service Management Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets
Storage
Networking
Networking - DNS
Traffic Manager
Application Gateway
SQL Database
Redis Cache
App Service - Web Apps
Resource Groups
Key Vault
CDN
Batch

Download

1.0 Beta 5

If you are using released builds from 1.0 beta 5, add the following to your POM file:

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure</artifactId>
    <version>1.0.0-beta5</version>
</dependency>

Pre-requisites

Help

If you are migrating your code to 1.0 beta 5, you can use these notes for preparing your code for 1.0 beta 5 from 1.0 beta 4.

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

Version SHA1 Remarks
1.0.0-beta4.1 1.0.0-beta4.1 Tagged release for 1.0.0-beta4.1 version of Azure management libraries
1.0.0-beta3 1.0.0-beta3 Tagged release for 1.0.0-beta3 version of Azure management libraries
1.0.0-beta2 1.0.0-beta2 Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta1 1.0.0-beta1 Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes v1.0.0-beta1+fixes Stable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS 0.9 Maintenance branch for service management libraries
0.9.3 v0.9.3 Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.