Observação
O acesso a essa página exige autorização. Você pode tentar entrar ou alterar diretórios.
O acesso a essa página exige autorização. Você pode tentar alterar os diretórios.
Visão geralOverview
A Rede Virtual do Azure permite a você conectar-se aos recursos do Azure e também conectá-los à sua rede local.Azure Virtual Network allows you to connect Azure resources, and also connect them to your on-premises network.
Para começar a usar a Rede Virtual do Azure, consulte Criar sua primeira rede virtual.To get started with Azure Virtual Network, see Create your first virtual network.
APIs de gerenciamentoManagement APIs
Inspecionar, gerenciar e configurar redes virtuais do Azure com as APIs de gerenciamento.Inspect, manage, and configure Azure virtual networks with the management APIs.
Diferentemente de outras APIs de Python do Azure, as APIs de rede são explicitamente divididas em versões em pacotes separados.Unlike other Azure python APIs, the networking APIs are explicitly versioned into separage packages. Você não precisa importá-las individualmente, pois as informações do pacote são especificadas no construtor do cliente.You do not need to import them individually since the package information is specified in the client constructor.
Instalar o pacote de gerenciamento com PIP.Install the management package with pip.
pip install azure-mgmt-network
ExemploExample
Criar uma rede virtual e uma sub-rede associado.Create a virtual network and an associated subnet.
from azure.mgmt.network import NetworkManagementClient
GROUP_NAME = 'resource-group'
VNET_NAME = 'your-vnet-identifier'
LOCATION = 'region'
SUBNET_NAME = 'your-subnet-identifier'
network_client = NetworkManagementClient(credentials, 'your-subscription-id')
async_vnet_creation = network_client.virtual_networks.create_or_update(
GROUP_NAME,
VNET_NAME,
{
'location': LOCATION,
'address_space': {
'address_prefixes': ['10.0.0.0/16']
}
}
)
async_vnet_creation.wait()
# Create Subnet
async_subnet_creation = network_client.subnets.create_or_update(
GROUP_NAME,
VNET_NAME,
SUBNET_NAME,
{'address_prefix': '10.0.0.0/24'}
)
subnet_info = async_subnet_creation.result()
ExemplosSamples
Veja a lista completa de exemplos da Rede Virtual do Azure.View the complete list of Azure Virtual Network samples.