azure-docs-sdk-java/docs-ref-services/network.md

2.4 KiB

title description keywords author ms.author manager ms.date ms.topic ms.prod ms.technology ms.devlang ms.service
Azure Network libraries for Java Reference documentation for the Java Azure Network management libraries Azure, Java, SDK, API, networking, load balancing, vnet , subnet rloutlaw routlaw douge 07/20/2017 reference azure azure java networking

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.US_EAST)
        .withExistingResourceGroup("myResourceGroup")
        .withAddressSpace("192.168.0.0/16")
        .defineSubnet("myVirtualNetwork")
            .withAddressPrefix("192.168.2.0/24")
            .attach()
        .create();

[!div class="nextstepaction"] Explore the Management APIs

Samples

Manage virtual networks
Manage network interfaces
Manage Application Gateways
Manage internet facing load balancers

Explore more sample Java code for Azure Networking you can use in your apps.