Azure Network libraries for Java

Overview

Connect Azure resources, filter and balance traffic, and manage routing with Azure Networking.

To get started with Azure Networking, see Create your first virtual network.

Management API

Create and manage Azure virtual networks , ExpressRoutes , and Application Gateways with the management API.

Add a dependency to your Maven pom.xml file to use the management API in your project.

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-mgmt-network</artifactId>
    <version>1.3.0</version>
</dependency>

Example

Create a new virtual network with a single subnet.

Network virtualNetwork1 = azure.networks().define(vnetName1)
        .withRegion(Region.CHINA_EAST)
        .withExistingResourceGroup("myResourceGroup")
        .withAddressSpace("192.168.0.0/16")
        .defineSubnet("myVirtualNetwork")
            .withAddressPrefix("192.168.2.0/24")
            .attach()
        .create();