你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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.azure.resourcemanager</groupId>
    <artifactId>azure-resourcemanager-network</artifactId>
    <version>2.7.0</version>
</dependency>

Example

Create a new virtual network with two subnets.

Network network = azure.networks().define("mynetwork")
	.withRegion(Region.US_EAST)
	.withNewResourceGroup()
	.withAddressSpace("10.0.0.0/28")
	.withSubnet("subnet1", "10.0.0.0/29")
	.withSubnet("subnet2", "10.0.0.8/29")
	.create();

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.