Load Balancers - Create Or Update
Creates or updates a load balancer.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}?api-version={api-version}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
subscriptionId
|
path | True |
|
The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
|
resourceGroupName
|
path | True |
|
The name of the resource group. |
|
loadBalancerName
|
path | True |
|
The name of the load balancer. |
|
api-version
|
query | True |
|
Client API version. |
Request Body
Media Types: "application/json", "text/json"
| Name | Required | Type | Description |
|---|---|---|---|
| backendAddressPools |
Collection of backend address pools used by a load balancer |
||
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
|
| frontendIPConfigurations |
Object representing the frontend IPs to be used for the load balancer |
||
| inboundNatPools |
Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. |
||
| inboundNatRules |
Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. |
||
| loadBalancingRules |
Object collection representing the load balancing rules Gets the provisioning |
||
| location | True |
|
Resource location. |
| outboundNatRules |
The outbound NAT rules. |
||
| probes |
|
Collection of probe objects used in the load balancer |
|
| provisioningState |
|
Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
|
| resourceGuid |
|
The resource GUID property of the load balancer resource. |
|
| sku |
The load balancer SKU. |
||
| tags |
|
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 201 Created |
Create successful. The operation returns the resulting LoadBalancer resource. Media Types: "application/json", "text/json" |
|
| 200 OK |
Update successful. The operation returns the resulting LoadBalancer resource. Media Types: "application/json", "text/json" |
Examples
Create load balancer
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2017-09-01
{
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
},
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
],
"inboundNatRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"
}
]
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
}
}
}
],
"probes": [
{
"name": "probe-lb",
"properties": {
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"backendPort": 3389,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp"
}
}
],
"inboundNatPools": [],
"outboundNatRules": []
}
}
Sample Response
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"location": "westus",
"sku": {
"name": "Basic"
},
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
},
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
],
"inboundNatRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"
}
]
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"properties": {
"provisioningState": "Succeeded",
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"disableOutboundSnat": false
}
}
],
"probes": [
{
"name": "probe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"inboundNatRules": [
{
"name": "in-nat-rule",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"backendPort": 3389,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp"
}
}
],
"outboundNatRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"location": "westus",
"sku": {
"name": "Basic"
},
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
},
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
],
"inboundNatRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"
}
]
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"properties": {
"provisioningState": "Succeeded",
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"disableOutboundSnat": false
}
}
],
"probes": [
{
"name": "probe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"inboundNatRules": [
{
"name": "in-nat-rule",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"backendPort": 3389,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp"
}
}
],
"outboundNatRules": [],
"inboundNatPools": []
}
}
Definitions
| BackendAddressPool |
Pool of backend IP addresses. |
| FrontendIPConfiguration |
Frontend IP address of the load balancer. |
| InboundNatPool |
Inbound NAT pool of the load balancer. |
| InboundNatRule |
Inbound NAT rule of the load balancer. |
| LoadBalancer | |
| LoadBalancerSku |
The load balancer SKU. |
| LoadBalancingRule |
A load balancing rule for a load balancer. |
| OutboundNatRule |
Outbound NAT pool of the load balancer. |
| Probe |
A load balancer probe. |
| SubResource |
Reference to another subresource. |
Pool of backend IP addresses.
| Name | Type | Description |
|---|---|---|
| backendIPConfigurations |
Gets collection of references to IP addresses defined in network interfaces. |
|
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| id |
|
Resource ID |
| loadBalancingRules |
Gets load balancing rules that use this backend address pool. |
|
| name |
|
Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| outboundNatRule |
Gets outbound rules that use this backend address pool. |
|
| provisioningState |
|
Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
Frontend IP address of the load balancer.
| Name | Type | Description |
|---|---|---|
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| id |
|
Resource ID |
| inboundNatPools |
Read only. Inbound pools URIs that use this frontend IP. |
|
| inboundNatRules |
Read only. Inbound rules URIs that use this frontend IP. |
|
| loadBalancingRules |
Gets load balancing rules URIs that use this frontend IP. |
|
| name |
|
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
| outboundNatRules |
Read only. Outbound rules URIs that use this frontend IP. |
|
| privateIPAddress |
|
The private IP address of the IP configuration. |
| privateIPAllocationMethod |
|
The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. |
| provisioningState |
|
Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
| publicIPAddress |
The reference of the Public IP resource. |
|
| subnet |
The reference of the subnet resource. |
|
| zones |
|
A list of availability zones denoting the IP allocated for the resource needs to come from. |
Inbound NAT pool of the load balancer.
| Name | Type | Description |
|---|---|---|
| backendPort |
|
The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. |
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| frontendIPConfiguration |
A reference to frontend IP addresses. |
|
| frontendPortRangeEnd |
|
The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. |
| frontendPortRangeStart |
|
The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. |
| id |
|
Resource ID |
| name |
|
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
| protocol |
|
The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All.' |
| provisioningState |
|
Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
Inbound NAT rule of the load balancer.
| Name | Type | Description |
|---|---|---|
| backendIPConfiguration |
A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. |
|
| backendPort |
|
The port used for the internal endpoint. Acceptable values range from 1 to 65535. |
| enableFloatingIP |
|
Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. |
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| frontendIPConfiguration |
A reference to frontend IP addresses. |
|
| frontendPort |
|
The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. |
| id |
|
Resource ID |
| idleTimeoutInMinutes |
|
The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. |
| name |
|
Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| protocol |
|
The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All.' |
| provisioningState |
|
Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
| Name | Type | Description |
|---|---|---|
| backendAddressPools |
Collection of backend address pools used by a load balancer |
|
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| frontendIPConfigurations |
Object representing the frontend IPs to be used for the load balancer |
|
| id |
|
Resource ID. |
| inboundNatPools |
Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. |
|
| inboundNatRules |
Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. |
|
| loadBalancingRules |
Object collection representing the load balancing rules Gets the provisioning |
|
| location |
|
Resource location. |
| name |
|
Resource name. |
| outboundNatRules |
The outbound NAT rules. |
|
| probes |
|
Collection of probe objects used in the load balancer |
| provisioningState |
|
Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
| resourceGuid |
|
The resource GUID property of the load balancer resource. |
| sku |
The load balancer SKU. |
|
| tags |
|
Resource tags. |
| type |
|
Resource type. |
The load balancer SKU.
| Name | Type | Description |
|---|---|---|
| name |
|
Name of a load balancer SKU. |
A load balancing rule for a load balancer.
| Name | Type | Description |
|---|---|---|
| backendAddressPool |
A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. |
|
| backendPort |
|
The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port" |
| disableOutboundSnat |
|
Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. |
| enableFloatingIP |
|
Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. |
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| frontendIPConfiguration |
A reference to frontend IP addresses. |
|
| frontendPort |
|
The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port" |
| id |
|
Resource ID |
| idleTimeoutInMinutes |
|
The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. |
| loadDistribution |
|
The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. |
| name |
|
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
| probe |
The reference of the load balancer probe used by the load balancing rule. |
|
| protocol |
|
The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All.' |
| provisioningState |
|
Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
Outbound NAT pool of the load balancer.
| Name | Type | Description |
|---|---|---|
| allocatedOutboundPorts |
|
The number of outbound ports to be used for NAT. |
| backendAddressPool |
A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. |
|
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| frontendIPConfigurations |
The Frontend IP addresses of the load balancer. |
|
| id |
|
Resource ID |
| name |
|
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
| provisioningState |
|
Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
A load balancer probe.
| Name | Type | Description |
|---|---|---|
| etag |
|
A unique read-only string that changes whenever the resource is updated. |
| id |
|
Resource ID |
| intervalInSeconds |
|
The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. |
| loadBalancingRules |
The load balancer rules that use this probe. |
|
| name |
|
Gets name of the resource that is unique within a resource group. This name can be used to access the resource. |
| numberOfProbes |
|
The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. |
| port |
|
The port for communicating the probe. Possible values range from 1 to 65535, inclusive. |
| protocol |
|
The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. |
| provisioningState |
|
Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. |
| requestPath |
|
The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. |
Reference to another subresource.
| Name | Type | Description |
|---|---|---|
| id |
|
Resource ID. |