sample
python
azure
This sample shows how to manage a load balancer using the Azure Resource Manager APIs for Python.
network-python-manage-loadbalancer
Getting Started with Azure Resource Manager for load balancers in PythonThis sample shows how to manage a load balancer using the Azure Resource Manager APIs for Python.
You can use a load balancer to provide high availability for your workloads in Azure. An Azure load balancer is a Layer-4 (TCP, UDP) type load balancer that distributes incoming traffic among healthy service instances in cloud services or virtual machines defined in a load balancer set.
For a detailed overview of Azure load balancers, see Azure Load Balancer overview.
This sample deploys an internet-facing load balancer. It then creates and deploys two Azure virtual machines behind the load balancer. For a detailed overview of internet-facing load balancers, see Internet-facing load balancer overview.
To deploy an internet-facing load balancer, you'll need to create and configure the following objects.
You can get more information about load balancer components with Azure resource manager at Azure Resource Manager support for Load Balancer.
Tasks performed in this sampleThe sample performs the following tasks to create the load balancer and the load-balanced virtual machines:
If you don't already have a Microsoft Azure subscription, you can register for a free trial account.
Install Python if you haven't already.
We recommend using a virtual environment to run this example, but it's not mandatory. You can initialize a virtual environment this way:
pip install virtualenv
virtualenv mytestenv
cd mytestenv
source bin/activate
Clone the sample repository.
git clone https://github.com/Azure-Samples/network-python-manage-loadbalancer.git
Install the dependencies using pip.
cd network-python-manage-loadbalancer
pip install -r requirements.txt
Create an Azure service principal, using Azure CLI, PowerShell or Azure Portal.
Export these environment variables into your current shell.
export AZURE_TENANT_ID={your tenant ID}
export AZURE_CLIENT_ID={your client ID}
export AZURE_CLIENT_SECRET={your client secret}
export AZURE_SUBSCRIPTION_ID={your subscription ID}
Run the sample.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4