or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.mdload-balancers.mdnetwork-interfaces.mdnetwork-security.mdvirtual-networks.md
tile.json

tessl/pypi-azure-mgmt-network

Microsoft Azure Network Management Client Library for Python

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-mgmt-network@29.0.x

To install, run

npx @tessl/cli install tessl/pypi-azure-mgmt-network@29.0.0

index.mddocs/

Azure Network Management Python SDK

Microsoft Azure Network Management Client Library for Python provides comprehensive programmatic access to Azure networking services through the Azure Resource Manager (ARM) API. This SDK enables developers to create, configure, and manage all Azure networking resources including virtual networks, load balancers, firewalls, VPN gateways, and advanced networking features.

Package Information

  • Package Name: azure-mgmt-network
  • Language: Python
  • Installation: pip install azure-mgmt-network
  • Version: 29.0.0
  • License: MIT

Core Imports

from azure.mgmt.network import NetworkManagementClient

For authentication:

from azure.identity import DefaultAzureCredential

For async operations:

from azure.mgmt.network.aio import NetworkManagementClient

Basic Usage

from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient

# Initialize credentials and client  
credential = DefaultAzureCredential()
subscription_id = "your-subscription-id"
client = NetworkManagementClient(credential, subscription_id)

# Create a virtual network
from azure.mgmt.network.models import VirtualNetwork, AddressSpace

vnet_params = VirtualNetwork(
    location="East US",
    address_space=AddressSpace(address_prefixes=["10.0.0.0/16"])
)

# Create or update virtual network (long-running operation)
operation = client.virtual_networks.begin_create_or_update(
    resource_group_name="my-resource-group",
    virtual_network_name="my-vnet",
    parameters=vnet_params
)
vnet_result = operation.result()  # Wait for completion

# List virtual networks in a resource group
vnets = list(client.virtual_networks.list(resource_group_name="my-resource-group"))

# Get specific virtual network
vnet = client.virtual_networks.get(
    resource_group_name="my-resource-group",
    virtual_network_name="my-vnet"
)

Architecture

The Azure Network Management SDK follows Azure's Resource Manager architecture with:

  • NetworkManagementClient: Main client providing access to all networking operations
  • Operations Classes: 156 specialized operation classes for different Azure networking services
  • Models: 1,066+ data model classes representing Azure network resources and configurations
  • Enumerations: 255+ enum classes for standardized values and options
  • Long-running Operations (LRO): Automatic polling for operations that take time to complete
  • Authentication: Integration with Azure Identity for secure credential management

The SDK covers the complete Azure networking ecosystem including core networking, security, connectivity, monitoring, and advanced features like network management and IPAM.

Capabilities

Virtual Networks and Subnets

Core virtual networking functionality for creating isolated network environments, managing subnets, configuring address spaces, and handling network peering relationships.

class VirtualNetworksOperations:
    def begin_create_or_update(self, resource_group_name: str, virtual_network_name: str, parameters: VirtualNetwork, **kwargs) -> LROPoller[VirtualNetwork]: ...
    def get(self, resource_group_name: str, virtual_network_name: str, **kwargs) -> VirtualNetwork: ...
    def begin_delete(self, resource_group_name: str, virtual_network_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[VirtualNetwork]: ...
    def list_all(self, **kwargs) -> Iterable[VirtualNetwork]: ...

class SubnetsOperations:
    def begin_create_or_update(self, resource_group_name: str, virtual_network_name: str, subnet_name: str, subnet_parameters: Subnet, **kwargs) -> LROPoller[Subnet]: ...
    def get(self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs) -> Subnet: ...
    def begin_delete(self, resource_group_name: str, virtual_network_name: str, subnet_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, virtual_network_name: str, **kwargs) -> Iterable[Subnet]: ...

Virtual Networks and Subnets

Load Balancers

Comprehensive load balancing services including basic and standard load balancers, backend pools, frontend configurations, health probes, and traffic distribution rules.

class LoadBalancersOperations:
    def begin_create_or_update(self, resource_group_name: str, load_balancer_name: str, parameters: LoadBalancer, **kwargs) -> LROPoller[LoadBalancer]: ...
    def get(self, resource_group_name: str, load_balancer_name: str, **kwargs) -> LoadBalancer: ...
    def begin_delete(self, resource_group_name: str, load_balancer_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[LoadBalancer]: ...
    def list_all(self, **kwargs) -> Iterable[LoadBalancer]: ...
    def begin_swap_public_ip_addresses(self, location: str, parameters: LoadBalancerVipSwapRequest, **kwargs) -> LROPoller[None]: ...

Load Balancers

Application Gateways

Layer 7 load balancing and web application firewall capabilities including SSL termination, URL-based routing, autoscaling, and WAF protection.

class ApplicationGatewaysOperations:
    def begin_create_or_update(self, resource_group_name: str, application_gateway_name: str, parameters: ApplicationGateway, **kwargs) -> LROPoller[ApplicationGateway]: ...
    def get(self, resource_group_name: str, application_gateway_name: str, **kwargs) -> ApplicationGateway: ...
    def begin_delete(self, resource_group_name: str, application_gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[ApplicationGateway]: ...
    def begin_start(self, resource_group_name: str, application_gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def begin_stop(self, resource_group_name: str, application_gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def begin_backend_health(self, resource_group_name: str, application_gateway_name: str, **kwargs) -> LROPoller[ApplicationGatewayBackendHealth]: ...

Note: Application Gateway operations provide Layer 7 load balancing with SSL termination, URL-based routing, autoscaling, and WAF protection capabilities.

Network Security

Network security services including Network Security Groups (NSGs), security rules, Application Security Groups (ASGs), and Azure's Network Security Perimeter features.

class NetworkSecurityGroupsOperations:
    def begin_create_or_update(self, resource_group_name: str, network_security_group_name: str, parameters: NetworkSecurityGroup, **kwargs) -> LROPoller[NetworkSecurityGroup]: ...
    def get(self, resource_group_name: str, network_security_group_name: str, **kwargs) -> NetworkSecurityGroup: ...
    def begin_delete(self, resource_group_name: str, network_security_group_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[NetworkSecurityGroup]: ...
    def list_all(self, **kwargs) -> Iterable[NetworkSecurityGroup]: ...

class SecurityRulesOperations:
    def begin_create_or_update(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, security_rule_parameters: SecurityRule, **kwargs) -> LROPoller[SecurityRule]: ...
    def get(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs) -> SecurityRule: ...
    def begin_delete(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, network_security_group_name: str, **kwargs) -> Iterable[SecurityRule]: ...

Network Security

Azure Firewalls

Next-generation firewall services including Azure Firewall, firewall policies, application and network rules, threat intelligence, and IDPS capabilities.

class AzureFirewallsOperations:
    def begin_create_or_update(self, resource_group_name: str, azure_firewall_name: str, parameters: AzureFirewall, **kwargs) -> LROPoller[AzureFirewall]: ...
    def get(self, resource_group_name: str, azure_firewall_name: str, **kwargs) -> AzureFirewall: ...
    def begin_delete(self, resource_group_name: str, azure_firewall_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[AzureFirewall]: ...
    def list_all(self, **kwargs) -> Iterable[AzureFirewall]: ...

class FirewallPoliciesOperations:
    def begin_create_or_update(self, resource_group_name: str, firewall_policy_name: str, parameters: FirewallPolicy, **kwargs) -> LROPoller[FirewallPolicy]: ...
    def get(self, resource_group_name: str, firewall_policy_name: str, **kwargs) -> FirewallPolicy: ...
    def begin_delete(self, resource_group_name: str, firewall_policy_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[FirewallPolicy]: ...

Note: Azure Firewall operations provide next-generation firewall services with threat intelligence, IDPS capabilities, and network/application rule management.

ExpressRoute

Private connectivity to Azure through ExpressRoute circuits, peerings, connections, gateways, and cross-connections for hybrid networking scenarios.

class ExpressRouteCircuitsOperations:
    def begin_create_or_update(self, resource_group_name: str, circuit_name: str, parameters: ExpressRouteCircuit, **kwargs) -> LROPoller[ExpressRouteCircuit]: ...
    def get(self, resource_group_name: str, circuit_name: str, **kwargs) -> ExpressRouteCircuit: ...
    def begin_delete(self, resource_group_name: str, circuit_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[ExpressRouteCircuit]: ...
    def list_all(self, **kwargs) -> Iterable[ExpressRouteCircuit]: ...

class ExpressRouteGatewaysOperations:
    def begin_create_or_update(self, resource_group_name: str, express_route_gateway_name: str, put_express_route_gateway_parameters: ExpressRouteGateway, **kwargs) -> LROPoller[ExpressRouteGateway]: ...
    def get(self, resource_group_name: str, express_route_gateway_name: str, **kwargs) -> ExpressRouteGateway: ...
    def begin_delete(self, resource_group_name: str, express_route_gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def list_by_resource_group(self, resource_group_name: str, **kwargs) -> Iterable[ExpressRouteGateway]: ...
    def list_by_subscription(self, **kwargs) -> Iterable[ExpressRouteGateway]: ...

Note: ExpressRoute operations provide private connectivity through circuits, peerings, connections, gateways, and cross-connections for hybrid scenarios.

VPN Gateways

Site-to-site and point-to-site VPN connectivity including virtual network gateways, VPN connections, Virtual WAN, VPN sites, and P2S VPN gateways.

class VirtualNetworkGatewaysOperations:
    def begin_create_or_update(self, resource_group_name: str, virtual_network_gateway_name: str, parameters: VirtualNetworkGateway, **kwargs) -> LROPoller[VirtualNetworkGateway]: ...
    def get(self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs) -> VirtualNetworkGateway: ...
    def begin_delete(self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[VirtualNetworkGateway]: ...
    def begin_reset(self, resource_group_name: str, virtual_network_gateway_name: str, **kwargs) -> LROPoller[VirtualNetworkGateway]: ...

class VpnGatewaysOperations:
    def begin_create_or_update(self, resource_group_name: str, gateway_name: str, vpn_gateway_parameters: VpnGateway, **kwargs) -> LROPoller[VpnGateway]: ...
    def get(self, resource_group_name: str, gateway_name: str, **kwargs) -> VpnGateway: ...
    def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs) -> LROPoller[None]: ...
    def list_by_resource_group(self, resource_group_name: str, **kwargs) -> Iterable[VpnGateway]: ...
    def list(self, **kwargs) -> Iterable[VpnGateway]: ...

Note: VPN Gateway operations provide site-to-site and point-to-site VPN connectivity with Virtual WAN integration.

Network Manager

Centralized network management for large-scale Azure networking including connectivity configurations, security admin configurations, and network grouping.

class NetworkManagersOperations:
    def begin_create_or_update(self, resource_group_name: str, network_manager_name: str, parameters: NetworkManager, **kwargs) -> LROPoller[NetworkManager]: ...
    def get(self, resource_group_name: str, network_manager_name: str, **kwargs) -> NetworkManager: ...
    def begin_delete(self, resource_group_name: str, network_manager_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[NetworkManager]: ...
    def list_by_subscription(self, **kwargs) -> Iterable[NetworkManager]: ...

class ConnectivityConfigurationsOperations:
    def create_or_update(self, resource_group_name: str, network_manager_name: str, configuration_name: str, connectivity_configuration: ConnectivityConfiguration, **kwargs) -> ConnectivityConfiguration: ...
    def get(self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs) -> ConnectivityConfiguration: ...
    def begin_delete(self, resource_group_name: str, network_manager_name: str, configuration_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, network_manager_name: str, **kwargs) -> Iterable[ConnectivityConfiguration]: ...

Note: Network Manager operations provide centralized management for large-scale Azure networking with connectivity and security configurations.

Network Interfaces and Public IPs

Network interface management, IP configurations, public IP addresses, custom IP prefixes, and network interface association operations.

class NetworkInterfacesOperations:
    def begin_create_or_update(self, resource_group_name: str, network_interface_name: str, parameters: NetworkInterface, **kwargs) -> LROPoller[NetworkInterface]: ...
    def get(self, resource_group_name: str, network_interface_name: str, **kwargs) -> NetworkInterface: ...
    def begin_delete(self, resource_group_name: str, network_interface_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[NetworkInterface]: ...
    def list_all(self, **kwargs) -> Iterable[NetworkInterface]: ...

class PublicIPAddressesOperations:
    def begin_create_or_update(self, resource_group_name: str, public_ip_address_name: str, parameters: PublicIPAddress, **kwargs) -> LROPoller[PublicIPAddress]: ...
    def get(self, resource_group_name: str, public_ip_address_name: str, **kwargs) -> PublicIPAddress: ...
    def begin_delete(self, resource_group_name: str, public_ip_address_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[PublicIPAddress]: ...
    def list_all(self, **kwargs) -> Iterable[PublicIPAddress]: ...

Network Interfaces and Public IPs

Route Management

Route tables, custom routes, route filters, route maps, and virtual router configurations for traffic routing and path control.

class RouteTablesOperations:
    def begin_create_or_update(self, resource_group_name: str, route_table_name: str, parameters: RouteTable, **kwargs) -> LROPoller[RouteTable]: ...
    def get(self, resource_group_name: str, route_table_name: str, **kwargs) -> RouteTable: ...
    def begin_delete(self, resource_group_name: str, route_table_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[RouteTable]: ...
    def list_all(self, **kwargs) -> Iterable[RouteTable]: ...

class RoutesOperations:
    def begin_create_or_update(self, resource_group_name: str, route_table_name: str, route_name: str, route_parameters: Route, **kwargs) -> LROPoller[Route]: ...
    def get(self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs) -> Route: ...
    def begin_delete(self, resource_group_name: str, route_table_name: str, route_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, route_table_name: str, **kwargs) -> Iterable[Route]: ...

Note: Route Management operations control traffic routing through route tables, custom routes, route filters, and virtual router configurations.

Private Link

Private endpoint and private link service management for secure, private connectivity to Azure services over the Azure backbone network.

class PrivateEndpointsOperations:
    def begin_create_or_update(self, resource_group_name: str, private_endpoint_name: str, parameters: PrivateEndpoint, **kwargs) -> LROPoller[PrivateEndpoint]: ...
    def get(self, resource_group_name: str, private_endpoint_name: str, **kwargs) -> PrivateEndpoint: ...
    def begin_delete(self, resource_group_name: str, private_endpoint_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[PrivateEndpoint]: ...
    def list_by_subscription(self, **kwargs) -> Iterable[PrivateEndpoint]: ...

class PrivateLinkServicesOperations:
    def begin_create_or_update(self, resource_group_name: str, service_name: str, parameters: PrivateLinkService, **kwargs) -> LROPoller[PrivateLinkService]: ...
    def get(self, resource_group_name: str, service_name: str, **kwargs) -> PrivateLinkService: ...
    def begin_delete(self, resource_group_name: str, service_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[PrivateLinkService]: ...
    def list_by_subscription(self, **kwargs) -> Iterable[PrivateLinkService]: ...

Note: Private Link operations provide secure, private connectivity to Azure services through private endpoints and private link services.

Network Monitoring

Network monitoring, diagnostics, and troubleshooting through Network Watcher, packet capture, connection monitoring, and flow logs.

class NetworkWatchersOperations:
    def create_or_update(self, resource_group_name: str, network_watcher_name: str, parameters: NetworkWatcher, **kwargs) -> NetworkWatcher: ...
    def get(self, resource_group_name: str, network_watcher_name: str, **kwargs) -> NetworkWatcher: ...
    def delete(self, resource_group_name: str, network_watcher_name: str, **kwargs) -> None: ...
    def list(self, resource_group_name: str, **kwargs) -> Iterable[NetworkWatcher]: ...
    def list_all(self, **kwargs) -> Iterable[NetworkWatcher]: ...
    def begin_verify_ip_flow(self, resource_group_name: str, network_watcher_name: str, parameters: VerificationIPFlowParameters, **kwargs) -> LROPoller[VerificationIPFlowResult]: ...
    def begin_next_hop(self, resource_group_name: str, network_watcher_name: str, parameters: NextHopParameters, **kwargs) -> LROPoller[NextHopResult]: ...
    def begin_get_security_group_view(self, resource_group_name: str, network_watcher_name: str, parameters: SecurityGroupViewParameters, **kwargs) -> LROPoller[SecurityGroupViewResult]: ...

class ConnectionMonitorsOperations:
    def begin_create_or_update(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, parameters: ConnectionMonitor, **kwargs) -> LROPoller[ConnectionMonitorResult]: ...
    def get(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs) -> ConnectionMonitorResult: ...
    def begin_delete(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs) -> LROPoller[None]: ...
    def list(self, resource_group_name: str, network_watcher_name: str, **kwargs) -> Iterable[ConnectionMonitorResult]: ...
    def begin_start(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs) -> LROPoller[None]: ...
    def begin_stop(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs) -> LROPoller[None]: ...
    def begin_query(self, resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, **kwargs) -> LROPoller[ConnectionMonitorQueryResult]: ...

Note: Network Monitoring operations provide network diagnostics, troubleshooting, packet capture, connection monitoring, and flow logging capabilities.

Virtual WAN and Hubs

Software-defined WAN architecture with virtual hubs, hub-to-hub connectivity, branch connections, and routing optimization.

class VirtualWansOperations:
    def begin_create_or_update(self, resource_group_name: str, virtual_wan_name: str, wan_parameters: VirtualWAN, **kwargs) -> LROPoller[VirtualWAN]: ...
    def get(self, resource_group_name: str, virtual_wan_name: str, **kwargs) -> VirtualWAN: ...
    def begin_delete(self, resource_group_name: str, virtual_wan_name: str, **kwargs) -> LROPoller[None]: ...
    def list_by_resource_group(self, resource_group_name: str, **kwargs) -> Iterable[VirtualWAN]: ...
    def list(self, **kwargs) -> Iterable[VirtualWAN]: ...

class VirtualHubsOperations:
    def begin_create_or_update(self, resource_group_name: str, virtual_hub_name: str, virtual_hub_parameters: VirtualHub, **kwargs) -> LROPoller[VirtualHub]: ...
    def get(self, resource_group_name: str, virtual_hub_name: str, **kwargs) -> VirtualHub: ...
    def begin_delete(self, resource_group_name: str, virtual_hub_name: str, **kwargs) -> LROPoller[None]: ...
    def list_by_resource_group(self, resource_group_name: str, **kwargs) -> Iterable[VirtualHub]: ...
    def list(self, **kwargs) -> Iterable[VirtualHub]: ...

Note: Virtual WAN operations provide software-defined WAN architecture with virtual hubs, hub-to-hub connectivity, and routing optimization.

Core Types

class NetworkManagementClient:
    def __init__(self, credential: TokenCredential, subscription_id: str, base_url: Optional[str] = None, **kwargs): ...
    def close(self) -> None: ...
    def __enter__(self) -> "NetworkManagementClient": ...
    def __exit__(self, *exc_details) -> None: ...

class LROPoller(Generic[PollingReturnType]):
    def result(self, timeout: Optional[int] = None) -> PollingReturnType: ...
    def wait(self, timeout: Optional[int] = None) -> None: ...
    def done(self) -> bool: ...
    def status(self) -> str: ...

# Common resource properties
class Resource:
    def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): ...
    location: Optional[str]
    tags: Optional[Dict[str, str]]
    id: Optional[str]  # Read-only
    name: Optional[str]  # Read-only
    type: Optional[str]  # Read-only

# Common provisioning states
class ProvisioningState(str, Enum):
    SUCCEEDED = "Succeeded"
    UPDATING = "Updating" 
    DELETING = "Deleting"
    FAILED = "Failed"

Authentication

# Required credential types
from azure.core.credentials import TokenCredential

# Common credential implementations
from azure.identity import (
    DefaultAzureCredential,
    ManagedIdentityCredential,
    ClientSecretCredential,
    ClientCertificateCredential,
    AzureCliCredential
)

Error Handling

The SDK uses Azure Core's error handling with these common exceptions:

  • ResourceNotFoundError: Resource doesn't exist (404)
  • ResourceExistsError: Resource already exists (409)
  • ClientAuthenticationError: Authentication failed (401)
  • HttpResponseError: General HTTP errors
  • ServiceRequestError: Request errors
  • ServiceResponseError: Response parsing errors

Long-Running Operations

Many operations return LROPoller objects for long-running operations:

# Start operation and get poller
poller = client.virtual_networks.begin_create_or_update(rg, name, params)

# Wait for completion and get result
result = poller.result(timeout=300)  # 5 minute timeout

# Check status without blocking
if poller.done():
    result = poller.result()