부하 분산 장치를 만들거나 업데이트합니다.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}?api-version=2024-05-01
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
loadBalancerName
|
path |
True
|
string
|
부하 분산 장치의 이름입니다.
|
resourceGroupName
|
path |
True
|
string
|
리소스 그룹의 이름입니다.
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 구독을 고유하게 식별하는 구독 자격 증명입니다. 구독 ID는 모든 서비스 호출에 대한 URI의 일부를 형성합니다.
|
api-version
|
query |
True
|
string
|
클라이언트 API 버전입니다.
|
요청 본문
Name |
형식 |
Description |
extendedLocation
|
ExtendedLocation
|
부하 분산 장치의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
properties.backendAddressPools
|
BackendAddressPool[]
|
부하 분산 장치에서 사용하는 백 엔드 주소 풀의 컬렉션입니다.
|
properties.frontendIPConfigurations
|
FrontendIPConfiguration[]
|
부하 분산 장치에 사용할 프런트 엔드 IP를 나타내는 개체입니다.
|
properties.inboundNatPools
|
InboundNatPool[]
|
부하 분산 장치와 연결된 NIC의 단일 백 엔드 포트에 대한 인바운드 NAT의 외부 포트 범위를 정의합니다. 인바운드 NAT 규칙은 이 범위의 외부 포트를 사용하여 Load Balancer와 연결된 각 NIC에 대해 자동으로 만들어집니다. Load Balancer에서 인바운드 NAT 풀을 정의하는 것은 인바운드 NAT 규칙 정의와 함께 사용할 수 없습니다. 인바운드 NAT 풀은 가상 머신 확장 집합에서 참조됩니다. 개별 가상 머신과 연결된 NIC는 인바운드 NAT 풀을 참조할 수 없습니다. 개별 인바운드 NAT 규칙을 참조해야 합니다.
|
properties.inboundNatRules
|
InboundNatRule[]
|
부하 분산 장치에서 사용하는 인바운드 NAT 규칙의 컬렉션입니다. 부하 분산 장치에서 인바운드 NAT 규칙을 정의하는 것은 인바운드 NAT 풀 정의와 함께 사용할 수 없습니다. 인바운드 NAT 풀은 가상 머신 확장 집합에서 참조됩니다. 개별 가상 머신과 연결된 NIC는 인바운드 NAT 풀을 참조할 수 없습니다. 개별 인바운드 NAT 규칙을 참조해야 합니다.
|
properties.loadBalancingRules
|
LoadBalancingRule[]
|
부하 분산 규칙을 나타내는 개체 컬렉션은 프로비저닝을 가져옵니다.
|
properties.outboundRules
|
OutboundRule[]
|
아웃바운드 규칙입니다.
|
properties.probes
|
Probe[]
|
부하 분산 장치에 사용되는 프로브 개체의 컬렉션입니다.
|
sku
|
LoadBalancerSku
|
부하 분산 장치 SKU입니다.
|
tags
|
object
|
리소스 태그.
|
응답
Name |
형식 |
Description |
200 OK
|
LoadBalancer
|
업데이트에 성공했습니다. 이 작업은 결과 LoadBalancer 리소스를 반환합니다.
|
201 Created
|
LoadBalancer
|
성공적으로 만듭니다. 이 작업은 결과 LoadBalancer 리소스를 반환합니다.
|
Other Status Codes
|
CloudError
|
작업이 실패한 이유를 설명하는 오류 응답입니다.
|
보안
azure_auth
Azure Active Directory OAuth2 Flow.
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
Create load balancer
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {}
}
],
"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",
"enableTcpReset": false,
"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,
"probeThreshold": 1
}
}
],
"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",
"enableTcpReset": false
}
}
],
"inboundNatPools": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreate.json
*/
/**
* Sample code: Create load balancer.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancer(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus").withFrontendIpConfigurations(
Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb").withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)
.withEnableTcpReset(false)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true).withEnableTcpReset(false)))
.withInboundNatPools(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"enableTcpReset": False,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": True,
"enableTcpReset": False,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreate.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
EnableTCPReset: to.Ptr(false),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(true),
EnableTCPReset: to.Ptr(false),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// EnableTCPReset: to.Ptr(false),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// EnableTCPReset: to.Ptr(false),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreate.json
*/
async function createLoadBalancer() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb" }],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
enableTcpReset: false,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: true,
enableTcpReset: false,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreate.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
EnableTcpReset = false,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
EnableTcpReset = false,
Name = "in-nat-rule",
}},
InboundNatPools = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Basic"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false,
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false
}
}
],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Basic"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false,
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false
}
}
],
"inboundNatPools": []
}
}
Create load balancer with Frontend IP in Zone 1
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
"zones": [
"1"
]
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {}
}
],
"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,
"probeThreshold": 1
}
}
],
"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": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithZones.
* json
*/
/**
* Sample code: Create load balancer with Frontend IP in Zone 1.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithFrontendIPInZone1(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withZones(Arrays.asList("1"))
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_with_zones.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
"zones": ["1"],
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithZones.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithZones.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFrontendIpInZone1() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
Zones: []*string{
to.Ptr("1")},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// Zones: []*string{
// to.Ptr("1")},
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithZones.json
*/
async function createLoadBalancerWithFrontendIPInZone1() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb" }],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
zones: ["1"],
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithZones.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Zones = {"1"},
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
Name = "in-nat-rule",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"zones": [
"1"
],
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"zones": [
"1"
],
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
},
"gatewayLoadBalancer": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {}
}
],
"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,
"probeThreshold": 1
}
}
],
"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": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateGatewayLoadBalancerConsumer.json
*/
/**
* Sample code: Create load balancer with Gateway Load Balancer Consumer configured.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithGatewayLoadBalancerConsumerConfigured(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))
.withGatewayLoadBalancer(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_gateway_load_balancer_consumer.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"gatewayLoadBalancer": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"
},
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
},
},
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerConsumerConfigured() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
GatewayLoadBalancer: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"),
},
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// GatewayLoadBalancer: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"),
// },
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json
*/
async function createLoadBalancerWithGatewayLoadBalancerConsumerConfigured() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb" }],
frontendIPConfigurations: [
{
name: "fe-lb",
gatewayLoadBalancer: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider",
},
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
GatewayLoadBalancerId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"),
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
Name = "in-nat-rule",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
],
"gatewayLoadBalancer": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
],
"gatewayLoadBalancer": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"tunnelInterfaces": [
{
"port": 15000,
"identifier": 900,
"protocol": "VXLAN",
"type": "Internal"
},
{
"port": 15001,
"identifier": 901,
"protocol": "VXLAN",
"type": "Internal"
}
]
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 0,
"backendPort": 0,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "All",
"loadDistribution": "Default",
"backendAddressPools": [
{
"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,
"probeThreshold": 1
}
}
],
"inboundNatPools": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.GatewayLoadBalancerTunnelInterface;
import com.azure.resourcemanager.network.models.GatewayLoadBalancerTunnelInterfaceType;
import com.azure.resourcemanager.network.models.GatewayLoadBalancerTunnelProtocol;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
*/
/**
* Sample code: Create load balancer with Gateway Load Balancer Provider configured with one Backend Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")
.withTunnelInterfaces(Arrays.asList(
new GatewayLoadBalancerTunnelInterface().withPort(15000).withIdentifier(900)
.withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN)
.withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL),
new GatewayLoadBalancerTunnelInterface().withPort(15001).withIdentifier(901)
.withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN)
.withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL)))))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPools(Arrays.asList(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.ALL).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(0).withBackendPort(0).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_gateway_load_balancer_provider_with_one_backend_pool.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"tunnelInterfaces": [
{"identifier": 900, "port": 15000, "protocol": "VXLAN", "type": "Internal"},
{"identifier": 901, "port": 15001, "protocol": "VXLAN", "type": "Internal"},
]
},
}
],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"inboundNatPools": [],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
}
],
"backendPort": 0,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 0,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "All",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Gateway"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{
{
Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
Identifier: to.Ptr[int32](900),
Port: to.Ptr[int32](15000),
Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
},
{
Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
Identifier: to.Ptr[int32](901),
Port: to.Ptr[int32](15001),
Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
}},
},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPools: []*armnetwork.SubResource{
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
}},
BackendPort: to.Ptr[int32](0),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](0),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolAll),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{
// {
// Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
// Identifier: to.Ptr[int32](900),
// Port: to.Ptr[int32](15000),
// Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
// },
// {
// Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
// Identifier: to.Ptr[int32](901),
// Port: to.Ptr[int32](15001),
// Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
// }},
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPools: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// }},
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
*/
async function createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [
{
name: "be-lb",
tunnelInterfaces: [
{ type: "Internal", identifier: 900, port: 15000, protocol: "VXLAN" },
{ type: "Internal", identifier: 901, port: 15001, protocol: "VXLAN" },
],
},
],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPools: [
{
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
],
backendPort: 0,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 0,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "All",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Gateway" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Gateway,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
TunnelInterfaces = {new GatewayLoadBalancerTunnelInterface
{
Port = 15000,
Identifier = 900,
Protocol = GatewayLoadBalancerTunnelProtocol.Vxlan,
InterfaceType = GatewayLoadBalancerTunnelInterfaceType.Internal,
}, new GatewayLoadBalancerTunnelInterface
{
Port = 15001,
Identifier = 901,
Protocol = GatewayLoadBalancerTunnelProtocol.Vxlan,
InterfaceType = GatewayLoadBalancerTunnelInterfaceType.Internal,
}},
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.All, 0)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPools = {new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
}},
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 0,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15000,
"identifier": 900,
"protocol": "VXLAN",
"type": "Internal"
},
{
"port": 15001,
"identifier": 901,
"protocol": "VXLAN",
"type": "Internal"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"backendAddressPools": [
{
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
]
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15000,
"identifier": 900,
"protocol": "VXLAN",
"type": "Internal"
},
{
"port": 15001,
"identifier": 901,
"protocol": "VXLAN",
"type": "Internal"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"backendAddressPools": [
{
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb1",
"properties": {}
},
{
"name": "be-lb2",
"properties": {}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 0,
"backendPort": 0,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "All",
"loadDistribution": "Default",
"backendAddressPool": {},
"backendAddressPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"
}
],
"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,
"probeThreshold": 1
}
}
],
"inboundNatPools": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
*/
/**
* Sample code: Create load balancer with Gateway Load Balancer Provider configured with two Backend Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb1"),
new BackendAddressPoolInner().withName("be-lb2")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource())
.withBackendAddressPools(Arrays.asList(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2")))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.ALL).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(0).withBackendPort(0).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_gateway_load_balancer_provider_with_two_backend_pool.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb1", "properties": {}}, {"name": "be-lb2", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"inboundNatPools": [],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {},
"backendAddressPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"
},
],
"backendPort": 0,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 0,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "All",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Gateway"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb1"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
},
{
Name: to.Ptr("be-lb2"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{},
BackendAddressPools: []*armnetwork.SubResource{
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
},
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"),
}},
BackendPort: to.Ptr[int32](0),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](0),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolAll),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
// Name: to.Ptr("be-lb1"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{
// {
// Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
// Identifier: to.Ptr[int32](900),
// Port: to.Ptr[int32](15000),
// Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
// }},
// },
// },
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"),
// Name: to.Ptr("be-lb2"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{
// {
// Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal),
// Identifier: to.Ptr[int32](901),
// Port: to.Ptr[int32](15001),
// Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN),
// }},
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPools: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
// },
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"),
// }},
// BackendPort: to.Ptr[int32](0),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](0),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameGateway),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
*/
async function createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb1" }, { name: "be-lb2" }],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {},
backendAddressPools: [
{
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1",
},
{
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2",
},
],
backendPort: 0,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 0,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "All",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Gateway" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Gateway,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb1",
}, new BackendAddressPoolData
{
Name = "be-lb2",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.All, 0)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPools = {new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"),
}, new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"),
}},
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 0,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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-lb1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15000,
"identifier": 900,
"protocol": "VXLAN",
"type": "Internal"
}
],
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
},
{
"name": "be-lb2",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15001,
"identifier": 901,
"protocol": "VXLAN",
"type": "Internal"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 0,
"backendPort": 0,
"enableFloatingIP": true,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Gateway"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
]
}
}
],
"backendAddressPools": [
{
"name": "be-lb1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15000,
"identifier": 900,
"protocol": "VXLAN",
"type": "Internal"
}
],
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
},
{
"name": "be-lb2",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"tunnelInterfaces": [
{
"port": 15001,
"identifier": 901,
"protocol": "VXLAN",
"type": "Internal"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"backendAddressPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
Create load balancer with Global Tier and one regional load balancer in its backend pool
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard",
"tier": "Global"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"loadBalancerBackendAddresses": [
{
"name": "regional-lb1-address",
"properties": {
"loadBalancerFrontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"
}
}
}
]
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": false,
"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,
"probeThreshold": 1
}
}
]
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerBackendAddress;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadBalancerSkuTier;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGlobalTier.
* json
*/
/**
* Sample code: Create load balancer with Global Tier and one regional load balancer in its backend pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(
new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD).withTier(LoadBalancerSkuTier.GLOBAL))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")
.withLoadBalancerBackendAddresses(Arrays.asList(new LoadBalancerBackendAddress()
.withName("regional-lb1-address")
.withLoadBalancerFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"))))))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(false)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx"))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_global_tier.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"loadBalancerBackendAddresses": [
{
"name": "regional-lb1-address",
"properties": {
"loadBalancerFrontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"
}
},
}
]
},
}
],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": False,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard", "tier": "Global"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGlobalTier.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGlobalTier.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{
{
Name: to.Ptr("regional-lb1-address"),
Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{
LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"),
},
},
}},
},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(false),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{
// {
// Name: to.Ptr("regional-lb1-address"),
// Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{
// LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"),
// },
// },
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(false),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGlobalTier.json
*/
async function createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [
{
name: "be-lb",
loadBalancerBackendAddresses: [
{
name: "regional-lb1-address",
loadBalancerFrontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb",
},
},
],
},
],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: false,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard", tier: "Global" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateGlobalTier.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
Tier = LoadBalancerSkuTier.Global,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
LoadBalancerBackendAddresses = {new LoadBalancerBackendAddress
{
Name = "regional-lb1-address",
LoadBalancerFrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"),
}},
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = false,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard",
"tier": "Global"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"loadBalancerBackendAddresses": [
{
"name": "regional-lb1-address",
"properties": {
"loadBalancerFrontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"
}
}
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": false,
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
]
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard",
"tier": "Global"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"loadBalancerBackendAddresses": [
{
"name": "regional-lb1-address",
"properties": {
"loadBalancerFrontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"
}
}
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": false,
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
]
}
}
]
}
}
Create load balancer with inbound nat pool
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"
}
},
"name": "test",
"zones": [],
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
}
],
"backendAddressPools": [],
"loadBalancingRules": [],
"probes": [],
"inboundNatRules": [],
"outboundRules": [],
"inboundNatPools": [
{
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
},
"protocol": "Tcp",
"frontendPortRangeStart": 8080,
"frontendPortRangeEnd": 8085,
"backendPort": 8888,
"idleTimeoutInMinutes": 10,
"enableFloatingIP": true,
"enableTcpReset": true
},
"name": "test",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"
}
]
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.InboundNatPool;
import com.azure.resourcemanager.network.models.IpAllocationMethod;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateWithInboundNatPool.json
*/
/**
* Sample code: Create load balancer with inbound nat pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithInboundNatPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")
.withName("test").withZones(Arrays.asList())
.withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC)
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"))))
.withBackendAddressPools(Arrays.asList()).withLoadBalancingRules(Arrays.asList())
.withProbes(Arrays.asList()).withInboundNatRules(Arrays.asList())
.withInboundNatPools(Arrays.asList(new InboundNatPool().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test")
.withName("test")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"))
.withProtocol(TransportProtocol.TCP).withFrontendPortRangeStart(8080).withFrontendPortRangeEnd(8085)
.withBackendPort(8888).withIdleTimeoutInMinutes(10).withEnableFloatingIp(true)
.withEnableTcpReset(true)))
.withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_with_inbound_nat_pool.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [],
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
"name": "test",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"
},
},
"zones": [],
}
],
"inboundNatPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test",
"name": "test",
"properties": {
"backendPort": 8888,
"enableFloatingIP": True,
"enableTcpReset": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
},
"frontendPortRangeEnd": 8085,
"frontendPortRangeStart": 8080,
"idleTimeoutInMinutes": 10,
"protocol": "Tcp",
},
}
],
"inboundNatRules": [],
"loadBalancingRules": [],
"outboundRules": [],
"probes": [],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithInboundNatPool.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithInboundNatPool.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboundNatPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
Name: to.Ptr("test"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"),
},
},
Zones: []*string{},
}},
InboundNatPools: []*armnetwork.InboundNatPool{
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"),
Name: to.Ptr("test"),
Properties: &armnetwork.InboundNatPoolPropertiesFormat{
BackendPort: to.Ptr[int32](8888),
EnableFloatingIP: to.Ptr(true),
EnableTCPReset: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
},
FrontendPortRangeEnd: to.Ptr[int32](8085),
FrontendPortRangeStart: to.Ptr[int32](8080),
IdleTimeoutInMinutes: to.Ptr[int32](10),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
InboundNatRules: []*armnetwork.InboundNatRule{},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// },
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
// Name: to.Ptr("test"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatPools: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"),
// Name: to.Ptr("test"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatPoolPropertiesFormat{
// BackendPort: to.Ptr[int32](8888),
// EnableFloatingIP: to.Ptr(true),
// EnableTCPReset: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
// },
// FrontendPortRangeEnd: to.Ptr[int32](8085),
// FrontendPortRangeStart: to.Ptr[int32](8080),
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// InboundNatRules: []*armnetwork.InboundNatRule{
// },
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// },
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithInboundNatPool.json
*/
async function createLoadBalancerWithInboundNatPool() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [],
frontendIPConfigurations: [
{
name: "test",
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
privateIPAllocationMethod: "Dynamic",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet",
},
zones: [],
},
],
inboundNatPools: [
{
name: "test",
backendPort: 8888,
enableFloatingIP: true,
enableTcpReset: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
},
frontendPortRangeEnd: 8085,
frontendPortRangeStart: 8080,
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test",
idleTimeoutInMinutes: 10,
protocol: "Tcp",
},
],
inboundNatRules: [],
loadBalancingRules: [],
location: "eastus",
outboundRules: [],
probes: [],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithInboundNatPool.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Zones = {},
PrivateIPAllocationMethod = NetworkIPAllocationMethod.Dynamic,
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"),
},
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
Name = "test",
}},
BackendAddressPools = { },
LoadBalancingRules = { },
Probes = { },
InboundNatRules = { },
InboundNatPools = {new LoadBalancerInboundNatPool
{
Properties = new LoadBalancerInboundNatPoolProperties(LoadBalancingTransportProtocol.Tcp, 8080, 8085, 8888)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"),
IdleTimeoutInMinutes = 10,
EnableFloatingIP = true,
EnableTcpReset = true,
},
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"),
Name = "test",
}},
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "test",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"
},
"inboundNatPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"
}
]
}
}
],
"backendAddressPools": [],
"loadBalancingRules": [],
"probes": [],
"inboundNatRules": [],
"outboundRules": [],
"inboundNatPools": [
{
"name": "test",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test",
"type": "Microsoft.Network/loadBalancers/inboundNatPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendPortRangeStart": 8080,
"frontendPortRangeEnd": 8085,
"backendPort": 8888,
"idleTimeoutInMinutes": 10,
"enableFloatingIP": true,
"protocol": "Tcp",
"enableTcpReset": true,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
}
}
}
]
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "test",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"
},
"inboundNatPools": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"
}
]
}
}
],
"backendAddressPools": [],
"loadBalancingRules": [],
"probes": [],
"inboundNatRules": [],
"outboundRules": [],
"inboundNatPools": [
{
"name": "test",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test",
"type": "Microsoft.Network/loadBalancers/inboundNatPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendPortRangeStart": 8080,
"frontendPortRangeEnd": 8085,
"backendPort": 8888,
"idleTimeoutInMinutes": 10,
"enableFloatingIP": true,
"protocol": "Tcp",
"enableTcpReset": true,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
}
}
}
]
}
}
Create load balancer with outbound rules
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"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"
},
"protocol": "Tcp",
"loadDistribution": "Default",
"frontendPort": 80,
"backendPort": 80,
"idleTimeoutInMinutes": 15,
"enableFloatingIP": true,
"disableOutboundSnat": true
}
}
],
"probes": [
{
"name": "probe-lb",
"properties": {
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1
}
}
],
"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": [],
"outboundRules": [
{
"name": "rule1",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
}
],
"protocol": "All"
}
}
]
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.OutboundRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner;
import com.azure.resourcemanager.network.models.LoadBalancerOutboundRuleProtocol;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateWithOutboundRules.json
*/
/**
* Sample code: Create load balancer with outbound rules.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithOutboundRules(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withPublicIpAddress(new PublicIpAddressInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)
.withDisableOutboundSnat(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withInboundNatPools(Arrays.asList())
.withOutboundRules(Arrays.asList(new OutboundRuleInner().withName("rule1")
.withFrontendIpConfigurations(Arrays.asList(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProtocol(LoadBalancerOutboundRuleProtocol.ALL))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_with_outbound_rules.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"
}
},
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"disableOutboundSnat": True,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"outboundRules": [
{
"name": "rule1",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
}
],
"protocol": "All",
},
}
],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithOutboundRules.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithOutboundRules.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutboundRules() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
PublicIPAddress: &armnetwork.PublicIPAddress{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
DisableOutboundSnat: to.Ptr(true),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
OutboundRules: []*armnetwork.OutboundRule{
{
Name: to.Ptr("rule1"),
Properties: &armnetwork.OutboundRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
FrontendIPConfigurations: []*armnetwork.SubResource{
{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
}},
Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll),
},
}},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// OutboundRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// OutboundRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"),
// }},
// PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// PublicIPAddress: &armnetwork.PublicIPAddress{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// EnableTCPReset: to.Ptr(false),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(true),
// EnableFloatingIP: to.Ptr(true),
// EnableTCPReset: to.Ptr(false),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"),
// Name: to.Ptr("rule1"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.OutboundRulePropertiesFormat{
// AllocatedOutboundPorts: to.Ptr[int32](1024),
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// EnableTCPReset: to.Ptr(false),
// FrontendIPConfigurations: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// }},
// IdleTimeoutInMinutes: to.Ptr[int32](4),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll),
// },
// }},
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithOutboundRules.json
*/
async function createLoadBalancerWithOutboundRules() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb" }],
frontendIPConfigurations: [
{
name: "fe-lb",
publicIPAddress: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip",
},
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
disableOutboundSnat: true,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
outboundRules: [
{
name: "rule1",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
frontendIPConfigurations: [
{
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
],
protocol: "All",
},
],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithOutboundRules.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
PublicIPAddress = new PublicIPAddressData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
DisableOutboundSnat = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
Name = "in-nat-rule",
}},
InboundNatPools = { },
OutboundRules = {new OutboundRuleData
{
FrontendIPConfigurations = {new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
}},
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
Protocol = LoadBalancerOutboundRuleProtocol.All,
Name = "rule1",
}},
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"
},
"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"
}
],
"outboundRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"
}
],
"privateIPAddressVersion": "IPv4"
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"outboundRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false,
"loadDistribution": "Default",
"disableOutboundSnat": true,
"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",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false
}
}
],
"outboundRules": [
{
"name": "rule1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1",
"type": "Microsoft.Network/loadBalancers/outboundRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"allocatedOutboundPorts": 1024,
"protocol": "All",
"enableTcpReset": false,
"idleTimeoutInMinutes": 4,
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
}
]
}
}
],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"
},
"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"
}
],
"outboundRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"
}
],
"privateIPAddressVersion": "IPv4"
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"outboundRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"
}
],
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false,
"loadDistribution": "Default",
"disableOutboundSnat": true,
"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",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"enableTcpReset": false
}
}
],
"outboundRules": [
{
"name": "rule1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1",
"type": "Microsoft.Network/loadBalancers/outboundRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"allocatedOutboundPorts": 1024,
"protocol": "All",
"enableTcpReset": false,
"idleTimeoutInMinutes": 4,
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
}
]
}
}
],
"inboundNatPools": []
}
}
Create load balancer with Standard SKU
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {}
}
],
"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,
"probeThreshold": 1
}
}
],
"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": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateStandardSku
* .json
*/
/**
* Sample code: Create load balancer with Standard SKU.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createLoadBalancerWithStandardSKU(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_standard_sku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [{"name": "be-lb", "properties": {}}],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateStandardSku.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateStandardSku.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStandardSku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateStandardSku.json
*/
async function createLoadBalancerWithStandardSku() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [{ name: "be-lb" }],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateStandardSku.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
Name = "in-nat-rule",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
Create load balancer with Sync Mode Property on Pool
샘플 요청
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb?api-version=2024-05-01
{
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
}
}
],
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"syncMode": "Automatic",
"virtualNetwork": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"
}
}
}
],
"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,
"probeThreshold": 1
}
}
],
"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": [],
"outboundRules": []
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.fluent.models.BackendAddressPoolInner;
import com.azure.resourcemanager.network.fluent.models.FrontendIpConfigurationInner;
import com.azure.resourcemanager.network.fluent.models.InboundNatRuleInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancerInner;
import com.azure.resourcemanager.network.fluent.models.LoadBalancingRuleInner;
import com.azure.resourcemanager.network.fluent.models.ProbeInner;
import com.azure.resourcemanager.network.fluent.models.SubnetInner;
import com.azure.resourcemanager.network.models.LoadBalancerSku;
import com.azure.resourcemanager.network.models.LoadBalancerSkuName;
import com.azure.resourcemanager.network.models.LoadDistribution;
import com.azure.resourcemanager.network.models.ProbeProtocol;
import com.azure.resourcemanager.network.models.SyncMode;
import com.azure.resourcemanager.network.models.TransportProtocol;
import java.util.Arrays;
/**
* Samples for LoadBalancers CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/
* LoadBalancerCreateWithSyncModePropertyOnPool.json
*/
/**
* Sample code: Create load balancer with Sync Mode Property on Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createLoadBalancerWithSyncModePropertyOnPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancers().createOrUpdate("rg1", "lb",
new LoadBalancerInner().withLocation("eastus")
.withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD))
.withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb")
.withSubnet(new SubnetInner().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"))))
.withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb")
.withVirtualNetwork(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"))
.withSyncMode(SyncMode.AUTOMATIC)))
.withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withBackendAddressPool(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))
.withProbe(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"))
.withProtocol(TransportProtocol.TCP).withLoadDistribution(LoadDistribution.DEFAULT)
.withFrontendPort(80).withBackendPort(80).withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withProbes(Arrays.asList(new ProbeInner().withName("probe-lb").withProtocol(ProbeProtocol.HTTP)
.withPort(80).withIntervalInSeconds(15).withNumberOfProbes(2).withProbeThreshold(1)
.withRequestPath("healthcheck.aspx")))
.withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule")
.withFrontendIpConfiguration(new SubResource().withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))
.withProtocol(TransportProtocol.TCP).withFrontendPort(3389).withBackendPort(3389)
.withIdleTimeoutInMinutes(15).withEnableFloatingIp(true)))
.withInboundNatPools(Arrays.asList()).withOutboundRules(Arrays.asList()),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python load_balancer_create_with_sync_mode_property_on_pool.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.load_balancers.begin_create_or_update(
resource_group_name="rg1",
load_balancer_name="lb",
parameters={
"location": "eastus",
"properties": {
"backendAddressPools": [
{
"name": "be-lb",
"properties": {
"syncMode": "Automatic",
"virtualNetwork": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"
},
},
}
],
"frontendIPConfigurations": [
{
"name": "fe-lb",
"properties": {
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
}
},
}
],
"inboundNatPools": [],
"inboundNatRules": [
{
"name": "in-nat-rule",
"properties": {
"backendPort": 3389,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 3389,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
},
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"properties": {
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
},
"backendPort": 80,
"enableFloatingIP": True,
"frontendIPConfiguration": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 15,
"loadDistribution": "Default",
"probe": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
},
"protocol": "Tcp",
},
}
],
"outboundRules": [],
"probes": [
{
"name": "probe-lb",
"properties": {
"intervalInSeconds": 15,
"numberOfProbes": 2,
"port": 80,
"probeThreshold": 1,
"protocol": "Http",
"requestPath": "healthcheck.aspx",
},
}
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json
func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithSyncModePropertyOnPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{
Location: to.Ptr("eastus"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
BackendAddressPools: []*armnetwork.BackendAddressPool{
{
Name: to.Ptr("be-lb"),
Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
SyncMode: to.Ptr(armnetwork.SyncModeAutomatic),
VirtualNetwork: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"),
},
},
}},
FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
{
Name: to.Ptr("fe-lb"),
Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
Subnet: &armnetwork.Subnet{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
},
}},
InboundNatPools: []*armnetwork.InboundNatPool{},
InboundNatRules: []*armnetwork.InboundNatRule{
{
Name: to.Ptr("in-nat-rule"),
Properties: &armnetwork.InboundNatRulePropertiesFormat{
BackendPort: to.Ptr[int32](3389),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](3389),
IdleTimeoutInMinutes: to.Ptr[int32](15),
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
LoadBalancingRules: []*armnetwork.LoadBalancingRule{
{
Name: to.Ptr("rulelb"),
Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
BackendAddressPool: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
},
BackendPort: to.Ptr[int32](80),
EnableFloatingIP: to.Ptr(true),
FrontendIPConfiguration: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
},
FrontendPort: to.Ptr[int32](80),
IdleTimeoutInMinutes: to.Ptr[int32](15),
LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
Probe: &armnetwork.SubResource{
ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
},
Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
},
}},
OutboundRules: []*armnetwork.OutboundRule{},
Probes: []*armnetwork.Probe{
{
Name: to.Ptr("probe-lb"),
Properties: &armnetwork.ProbePropertiesFormat{
IntervalInSeconds: to.Ptr[int32](15),
NumberOfProbes: to.Ptr[int32](2),
Port: to.Ptr[int32](80),
ProbeThreshold: to.Ptr[int32](1),
RequestPath: to.Ptr("healthcheck.aspx"),
Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
},
}},
},
SKU: &armnetwork.LoadBalancerSKU{
Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.LoadBalancer = armnetwork.LoadBalancer{
// Name: to.Ptr("lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"),
// Location: to.Ptr("eastus"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancerPropertiesFormat{
// BackendAddressPools: []*armnetwork.BackendAddressPool{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// Name: to.Ptr("be-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.BackendAddressPoolPropertiesFormat{
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// SyncMode: to.Ptr(armnetwork.SyncModeAutomatic),
// VirtualNetwork: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"),
// },
// },
// }},
// FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// Name: to.Ptr("fe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{
// InboundNatRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// }},
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// PrivateIPAddress: to.Ptr("10.0.1.4"),
// PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Subnet: &armnetwork.Subnet{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
// },
// },
// }},
// InboundNatPools: []*armnetwork.InboundNatPool{
// },
// InboundNatRules: []*armnetwork.InboundNatRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"),
// Name: to.Ptr("in-nat-rule"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.InboundNatRulePropertiesFormat{
// BackendPort: to.Ptr[int32](3389),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](3389),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// LoadBalancingRules: []*armnetwork.LoadBalancingRule{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// Name: to.Ptr("rulelb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.LoadBalancingRulePropertiesFormat{
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
// },
// BackendPort: to.Ptr[int32](80),
// DisableOutboundSnat: to.Ptr(false),
// EnableFloatingIP: to.Ptr(true),
// FrontendIPConfiguration: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
// },
// FrontendPort: to.Ptr[int32](80),
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault),
// Probe: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// },
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.TransportProtocolTCP),
// },
// }},
// OutboundRules: []*armnetwork.OutboundRule{
// },
// Probes: []*armnetwork.Probe{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
// Name: to.Ptr("probe-lb"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/probes"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""),
// Properties: &armnetwork.ProbePropertiesFormat{
// IntervalInSeconds: to.Ptr[int32](15),
// LoadBalancingRules: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"),
// }},
// NumberOfProbes: to.Ptr[int32](2),
// Port: to.Ptr[int32](80),
// ProbeThreshold: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RequestPath: to.Ptr("healthcheck.aspx"),
// Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP),
// },
// }},
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"),
// },
// SKU: &armnetwork.LoadBalancerSKU{
// Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a load balancer.
*
* @summary Creates or updates a load balancer.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json
*/
async function createLoadBalancerWithSyncModePropertyOnPool() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const loadBalancerName = "lb";
const parameters = {
backendAddressPools: [
{
name: "be-lb",
syncMode: "Automatic",
virtualNetwork: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb",
},
},
],
frontendIPConfigurations: [
{
name: "fe-lb",
subnet: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb",
},
},
],
inboundNatPools: [],
inboundNatRules: [
{
name: "in-nat-rule",
backendPort: 3389,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 3389,
idleTimeoutInMinutes: 15,
protocol: "Tcp",
},
],
loadBalancingRules: [
{
name: "rulelb",
backendAddressPool: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb",
},
backendPort: 80,
enableFloatingIP: true,
frontendIPConfiguration: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
},
frontendPort: 80,
idleTimeoutInMinutes: 15,
loadDistribution: "Default",
probe: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb",
},
protocol: "Tcp",
},
],
location: "eastus",
outboundRules: [],
probes: [
{
name: "probe-lb",
intervalInSeconds: 15,
numberOfProbes: 2,
port: 80,
probeThreshold: 1,
requestPath: "healthcheck.aspx",
protocol: "Http",
},
],
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
resourceGroupName,
loadBalancerName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json
// this example is just showing the usage of "LoadBalancers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this LoadBalancerResource
LoadBalancerCollection collection = resourceGroupResource.GetLoadBalancers();
// invoke the operation
string loadBalancerName = "lb";
LoadBalancerData data = new LoadBalancerData
{
Sku = new LoadBalancerSku
{
Name = LoadBalancerSkuName.Standard,
},
FrontendIPConfigurations = {new FrontendIPConfigurationData
{
Subnet = new SubnetData
{
Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"),
},
Name = "fe-lb",
}},
BackendAddressPools = {new BackendAddressPoolData
{
VirtualNetworkId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"),
SyncMode = BackendAddressSyncMode.Automatic,
Name = "be-lb",
}},
LoadBalancingRules = {new LoadBalancingRuleData
{
Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80)
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"),
ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"),
LoadDistribution = LoadDistribution.Default,
BackendPort = 80,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
},
Name = "rulelb",
}},
Probes = {new ProbeData
{
Protocol = ProbeProtocol.Http,
Port = 80,
IntervalInSeconds = 15,
NumberOfProbes = 2,
ProbeThreshold = 1,
RequestPath = "healthcheck.aspx",
Name = "probe-lb",
}},
InboundNatRules = {new InboundNatRuleData
{
FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"),
Protocol = LoadBalancingTransportProtocol.Tcp,
FrontendPort = 3389,
BackendPort = 3389,
IdleTimeoutInMinutes = 15,
EnableFloatingIP = true,
Name = "in-nat-rule",
}},
InboundNatPools = { },
OutboundRules = { },
Location = new AzureLocation("eastus"),
};
ArmOperation<LoadBalancerResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data);
LoadBalancerResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
LoadBalancerData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"virtualNetwork": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"
},
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
],
"syncMode": "Automatic"
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
{
"name": "lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb",
"type": "Microsoft.Network/loadBalancers",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"location": "eastus",
"sku": {
"name": "Standard"
},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "00000000-0000-0000-0000-00000000",
"frontendIPConfigurations": [
{
"name": "fe-lb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/backendAddressPools",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"virtualNetwork": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"
},
"loadBalancingRules": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"
}
],
"syncMode": "Automatic"
}
}
],
"loadBalancingRules": [
{
"name": "rulelb",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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",
"type": "Microsoft.Network/loadBalancers/probes",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Http",
"port": 80,
"requestPath": "healthcheck.aspx",
"intervalInSeconds": 15,
"numberOfProbes": 2,
"probeThreshold": 1,
"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",
"type": "Microsoft.Network/loadBalancers/inboundNatRules",
"etag": "W/\"00000000-0000-0000-0000-00000000\"",
"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"
}
}
],
"outboundRules": [],
"inboundNatPools": []
}
}
정의
ApplicationGatewayBackendAddress
애플리케이션 게이트웨이의 백 엔드 주소입니다.
Name |
형식 |
Description |
fqdn
|
string
|
FQDN(정규화된 도메인 이름)입니다.
|
ipAddress
|
string
|
IP 주소.
|
ApplicationGatewayBackendAddressPool
애플리케이션 게이트웨이의 백 엔드 주소 풀입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
Application Gateway 내에서 고유한 백 엔드 주소 풀의 이름입니다.
|
properties.backendAddresses
|
ApplicationGatewayBackendAddress[]
|
백 엔드 주소입니다.
|
properties.backendIPConfigurations
|
NetworkInterfaceIPConfiguration[]
|
네트워크 인터페이스에 정의된 IP에 대한 참조 컬렉션입니다.
|
properties.provisioningState
|
ProvisioningState
|
백 엔드 주소 풀 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 유형입니다.
|
ApplicationGatewayIPConfiguration
애플리케이션 게이트웨이의 IP 구성입니다. 현재 1개 공용 및 1개 개인 IP 구성이 허용됩니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
Application Gateway 내에서 고유한 IP 구성의 이름입니다.
|
properties.provisioningState
|
ProvisioningState
|
애플리케이션 게이트웨이 IP 구성 리소스의 프로비전 상태입니다.
|
properties.subnet
|
SubResource
|
서브넷 리소스에 대한 참조입니다. 애플리케이션 게이트웨이가 프라이빗 주소를 가져오는 서브넷입니다.
|
type
|
string
|
리소스의 유형입니다.
|
ApplicationSecurityGroup
리소스 그룹의 애플리케이션 보안 그룹입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.provisioningState
|
ProvisioningState
|
애플리케이션 보안 그룹 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
애플리케이션 보안 그룹 리소스의 리소스 GUID 속성입니다. 사용자가 이름을 변경하거나 구독 또는 리소스 그룹 간에 리소스를 마이그레이션하더라도 리소스를 고유하게 식별합니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
AutoApproval
프라이빗 링크 서비스의 자동 승인 목록입니다.
Name |
형식 |
Description |
subscriptions
|
string[]
|
구독 목록입니다.
|
BackendAddressPool
백 엔드 IP 주소의 풀입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 백 엔드 주소 풀 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.backendIPConfigurations
|
NetworkInterfaceIPConfiguration[]
|
네트워크 인터페이스에 정의된 IP 주소에 대한 참조 배열입니다.
|
properties.drainPeriodInSeconds
|
integer
|
클라이언트 및 백 엔드 주소로 RESET를 보내기 전에 Load Balancer가 대기하는 시간(초)입니다.
|
properties.inboundNatRules
|
SubResource[]
|
이 백 엔드 주소 풀을 사용하는 인바운드 NAT 규칙에 대한 참조 배열입니다.
|
properties.loadBalancerBackendAddresses
|
LoadBalancerBackendAddress[]
|
백 엔드 주소의 배열입니다.
|
properties.loadBalancingRules
|
SubResource[]
|
이 백 엔드 주소 풀을 사용하는 부하 분산 규칙에 대한 참조 배열입니다.
|
properties.location
|
string
|
백 엔드 주소 풀의 위치입니다.
|
properties.outboundRule
|
SubResource
|
이 백 엔드 주소 풀을 사용하는 아웃바운드 규칙에 대한 참조입니다.
|
properties.outboundRules
|
SubResource[]
|
이 백 엔드 주소 풀을 사용하는 아웃바운드 규칙에 대한 참조 배열입니다.
|
properties.provisioningState
|
ProvisioningState
|
백 엔드 주소 풀 리소스의 프로비전 상태입니다.
|
properties.syncMode
|
SyncMode
|
백 엔드 풀에 대한 백 엔드 주소 동기 모드
|
properties.tunnelInterfaces
|
GatewayLoadBalancerTunnelInterface[]
|
게이트웨이 부하 분산 장치 터널 인터페이스의 배열입니다.
|
properties.virtualNetwork
|
SubResource
|
가상 네트워크에 대한 참조입니다.
|
type
|
string
|
리소스의 유형입니다.
|
CloudError
서비스의 오류 응답입니다.
CloudErrorBody
서비스의 오류 응답입니다.
Name |
형식 |
Description |
code
|
string
|
오류의 식별자입니다. 코드는 고정적이며 프로그래밍 방식으로 사용할 수 있습니다.
|
details
|
CloudErrorBody[]
|
오류에 대한 추가 세부 정보 목록입니다.
|
message
|
string
|
사용자 인터페이스에 표시하기에 적합한 오류를 설명하는 메시지입니다.
|
target
|
string
|
특정 오류의 대상입니다. 예를 들어 오류가 발생한 속성의 이름입니다.
|
고객의 사용자 지정 Dns 확인 구성을 포함합니다.
Name |
형식 |
Description |
fqdn
|
string
|
프라이빗 엔드포인트 IP 주소로 확인되는 Fqdn입니다.
|
ipAddresses
|
string[]
|
프라이빗 엔드포인트의 개인 IP 주소 목록입니다.
|
DdosSettings
공용 IP의 DDoS 보호 설정을 포함합니다.
DdosSettingsProtectionMode
공용 IP의 DDoS 보호 모드
Name |
형식 |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
VirtualNetworkInherited
|
string
|
|
Delegation
서브넷이 위임되는 서비스에 대해 자세히 설명합니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
서브넷 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.actions
|
string[]
|
위임 시 서비스에 허용되는 작업입니다.
|
properties.provisioningState
|
ProvisioningState
|
서비스 위임 리소스의 프로비전 상태입니다.
|
properties.serviceName
|
string
|
서브넷을 위임해야 하는 서비스 이름(예: Microsoft.Sql/servers)입니다.
|
type
|
string
|
리소스 종류입니다.
|
DeleteOptions
공용 IP 주소를 사용하는 VM이 삭제될 때 발생하는 작업 지정
Name |
형식 |
Description |
Delete
|
string
|
|
Detach
|
string
|
|
ExtendedLocation
ExtendedLocation 복합 형식입니다.
ExtendedLocationTypes
확장된 위치의 형식입니다.
Name |
형식 |
Description |
EdgeZone
|
string
|
|
FlowLog
흐름 로그 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
identity
|
ManagedServiceIdentity
|
FlowLog 리소스 관리 ID
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.enabled
|
boolean
|
흐름 로깅을 사용하거나 사용하지 않도록 설정하는 플래그입니다.
|
properties.enabledFilteringCriteria
|
string
|
SrcIP, SrcPort, DstIP, DstPort, 프로토콜, 암호화, 방향 및 작업을 기반으로 네트워크 트래픽 로그를 필터링하는 선택적 필드입니다. 지정하지 않으면 모든 네트워크 트래픽이 기록됩니다.
|
properties.flowAnalyticsConfiguration
|
TrafficAnalyticsProperties
|
트래픽 분석의 구성을 정의하는 매개 변수입니다.
|
properties.format
|
FlowLogFormatParameters
|
흐름 로그 형식을 정의하는 매개 변수입니다.
|
properties.provisioningState
|
ProvisioningState
|
흐름 로그의 프로비전 상태입니다.
|
properties.retentionPolicy
|
RetentionPolicyParameters
|
흐름 로그에 대한 보존 정책을 정의하는 매개 변수입니다.
|
properties.storageId
|
string
|
흐름 로그를 저장하는 데 사용되는 스토리지 계정의 ID입니다.
|
properties.targetResourceGuid
|
string
|
흐름 로그를 적용할 네트워크 보안 그룹의 Guid입니다.
|
properties.targetResourceId
|
string
|
흐름 로그를 적용할 네트워크 보안 그룹의 ID입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
흐름 로그 형식을 정의하는 매개 변수입니다.
Name |
형식 |
Default value |
Description |
type
|
FlowLogFormatType
|
|
흐름 로그의 파일 형식입니다.
|
version
|
integer
|
0
|
흐름 로그의 버전(수정 버전)입니다.
|
흐름 로그의 파일 형식입니다.
Name |
형식 |
Description |
JSON
|
string
|
|
FrontendIPConfiguration
부하 분산 장치의 프런트 엔드 IP 주소입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 프런트 엔드 IP 구성 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.gatewayLoadBalancer
|
SubResource
|
게이트웨이 부하 분산 장치 프런트 엔드 IP에 대한 참조입니다.
|
properties.inboundNatPools
|
SubResource[]
|
이 프런트 엔드 IP를 사용하는 인바운드 풀에 대한 참조 배열입니다.
|
properties.inboundNatRules
|
SubResource[]
|
이 프런트 엔드 IP를 사용하는 인바운드 규칙에 대한 참조 배열입니다.
|
properties.loadBalancingRules
|
SubResource[]
|
이 프런트 엔드 IP를 사용하는 부하 분산 규칙에 대한 참조 배열입니다.
|
properties.outboundRules
|
SubResource[]
|
이 프런트 엔드 IP를 사용하는 아웃바운드 규칙에 대한 참조 배열입니다.
|
properties.privateIPAddress
|
string
|
IP 구성의 개인 IP 주소입니다.
|
properties.privateIPAddressVersion
|
IPVersion
|
특정 ipconfiguration이 IPv4 또는 IPv6인지 여부입니다. 기본값은 IPv4로 사용됩니다.
|
properties.privateIPAllocationMethod
|
IPAllocationMethod
|
개인 IP 할당 방법입니다.
|
properties.provisioningState
|
ProvisioningState
|
프런트 엔드 IP 구성 리소스의 프로비전 상태입니다.
|
properties.publicIPAddress
|
PublicIPAddress
|
공용 IP 리소스에 대한 참조입니다.
|
properties.publicIPPrefix
|
SubResource
|
공용 IP 접두사 리소스에 대한 참조입니다.
|
properties.subnet
|
Subnet
|
서브넷 리소스에 대한 참조입니다.
|
type
|
string
|
리소스의 유형입니다.
|
zones
|
string[]
|
리소스에 할당된 IP를 나타내는 가용성 영역의 목록입니다.
|
GatewayLoadBalancerTunnelInterface
부하 분산 장치 백 엔드 주소 풀의 게이트웨이 부하 분산 장치 터널 인터페이스입니다.
GatewayLoadBalancerTunnelInterfaceType
게이트웨이 부하 분산 장치 터널 인터페이스의 트래픽 유형입니다.
Name |
형식 |
Description |
External
|
string
|
|
Internal
|
string
|
|
None
|
string
|
|
GatewayLoadBalancerTunnelProtocol
게이트웨이 부하 분산 장치 터널 인터페이스의 프로토콜입니다.
Name |
형식 |
Description |
Native
|
string
|
|
None
|
string
|
|
VXLAN
|
string
|
|
InboundNatPool
부하 분산 장치의 인바운드 NAT 풀입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 인바운드 NAT 풀 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.backendPort
|
integer
|
엔드포인트의 내부 연결에 사용되는 포트입니다. 허용되는 값은 1에서 65535 사이입니다.
|
properties.enableFloatingIP
|
boolean
|
SQL AlwaysOn 가용성 그룹을 구성하는 데 필요한 부동 IP 기능에 대한 가상 머신의 엔드포인트를 구성합니다. 이 설정은 SQL Server에서 SQL AlwaysOn 가용성 그룹을 사용할 때 필요합니다. 엔드포인트를 만든 후에는 이 설정을 변경할 수 없습니다.
|
properties.enableTcpReset
|
boolean
|
TCP 흐름 유휴 시간 제한 또는 예기치 않은 연결 종료 시 양방향 TCP 재설정을 받습니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.frontendIPConfiguration
|
SubResource
|
프런트 엔드 IP 주소에 대한 참조입니다.
|
properties.frontendPortRangeEnd
|
integer
|
부하 분산 장치와 연결된 NIC에 인바운드 Nat를 제공하는 데 사용할 외부 포트 범위의 마지막 포트 번호입니다. 허용되는 값 범위는 1에서 65535 사이입니다.
|
properties.frontendPortRangeStart
|
integer
|
부하 분산 장치와 연결된 NIC에 인바운드 Nat를 제공하는 데 사용할 외부 포트 범위의 첫 번째 포트 번호입니다. 허용되는 값 범위는 1에서 65534 사이입니다.
|
properties.idleTimeoutInMinutes
|
integer
|
TCP 유휴 연결에 대한 시간 제한입니다. 값은 4분에서 30분 사이로 설정할 수 있습니다. 기본값은 4분입니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.protocol
|
TransportProtocol
|
인바운드 NAT 풀에서 사용하는 전송 프로토콜에 대한 참조입니다.
|
properties.provisioningState
|
ProvisioningState
|
인바운드 NAT 풀 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 유형입니다.
|
InboundNatRule
부하 분산 장치의 인바운드 NAT 규칙입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 인바운드 NAT 규칙 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.backendAddressPool
|
SubResource
|
backendAddressPool 리소스에 대한 참조입니다.
|
properties.backendIPConfiguration
|
NetworkInterfaceIPConfiguration
|
VM의 네트워크 인터페이스에 정의된 개인 IP 주소에 대한 참조입니다. 각 프런트 엔드 IP 구성의 프런트 엔드 포트로 전송되는 트래픽은 백 엔드 IP로 전달됩니다.
|
properties.backendPort
|
integer
|
내부 엔드포인트에 사용되는 포트입니다. 허용되는 값의 범위는 1에서 65535까지입니다.
|
properties.enableFloatingIP
|
boolean
|
SQL AlwaysOn 가용성 그룹을 구성하는 데 필요한 부동 IP 기능에 대한 가상 머신의 엔드포인트를 구성합니다. 이 설정은 SQL Server에서 SQL AlwaysOn 가용성 그룹을 사용할 때 필요합니다. 엔드포인트를 만든 후에는 이 설정을 변경할 수 없습니다.
|
properties.enableTcpReset
|
boolean
|
TCP 흐름 유휴 시간 제한 또는 예기치 않은 연결 종료 시 양방향 TCP 재설정을 받습니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.frontendIPConfiguration
|
SubResource
|
프런트 엔드 IP 주소에 대한 참조입니다.
|
properties.frontendPort
|
integer
|
외부 엔드포인트의 포트입니다. 각 규칙의 포트 번호는 Load Balancer 내에서 고유해야 합니다. 허용되는 값 범위는 1에서 65534까지입니다.
|
properties.frontendPortRangeEnd
|
integer
|
외부 엔드포인트의 포트 범위 끝입니다. 이 속성은 BackendAddressPool 및 FrontendPortRangeStart와 함께 사용됩니다. BackendAddressPool의 각 백 엔드 주소에 대해 개별 인바운드 NAT 규칙 포트 매핑이 만들어집니다. 허용되는 값 범위는 1에서 65534까지입니다.
|
properties.frontendPortRangeStart
|
integer
|
포트 범위는 외부 엔드포인트에 대해 시작합니다. 이 속성은 BackendAddressPool 및 FrontendPortRangeEnd와 함께 사용됩니다. BackendAddressPool의 각 백 엔드 주소에 대해 개별 인바운드 NAT 규칙 포트 매핑이 만들어집니다. 허용되는 값 범위는 1에서 65534까지입니다.
|
properties.idleTimeoutInMinutes
|
integer
|
TCP 유휴 연결에 대한 시간 제한입니다. 값은 4분에서 30분 사이로 설정할 수 있습니다. 기본값은 4분입니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.protocol
|
TransportProtocol
|
부하 분산 규칙에 사용되는 전송 프로토콜에 대한 참조입니다.
|
properties.provisioningState
|
ProvisioningState
|
인바운드 NAT 규칙 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 유형입니다.
|
IPAllocationMethod
IP 주소 할당 방법입니다.
Name |
형식 |
Description |
Dynamic
|
string
|
|
Static
|
string
|
|
IpamPoolPrefixAllocation
IpamPool 접두사 할당 참조입니다.
Name |
형식 |
Description |
allocatedAddressPrefixes
|
string[]
|
연결된 리소스의 IpamPool에 있는 할당된 IP 주소 접두사 목록입니다.
|
numberOfIpAddresses
|
string
|
할당할 IP 주소 수입니다.
|
pool.id
|
string
|
연결된 Azure IpamPool 리소스의 리소스 ID입니다.
|
IPConfiguration
IP 구성.
Name |
형식 |
Default value |
Description |
etag
|
string
|
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
|
리소스 ID입니다.
|
name
|
string
|
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.privateIPAddress
|
string
|
|
IP 구성의 개인 IP 주소입니다.
|
properties.privateIPAllocationMethod
|
IPAllocationMethod
|
Dynamic
|
개인 IP 주소 할당 방법입니다.
|
properties.provisioningState
|
ProvisioningState
|
|
IP 구성 리소스의 프로비전 상태입니다.
|
properties.publicIPAddress
|
PublicIPAddress
|
|
공용 IP 리소스에 대한 참조입니다.
|
properties.subnet
|
Subnet
|
|
서브넷 리소스에 대한 참조입니다.
|
IPConfigurationProfile
IP 구성 프로필 자식 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.provisioningState
|
ProvisioningState
|
IP 구성 프로필 리소스의 프로비전 상태입니다.
|
properties.subnet
|
Subnet
|
컨테이너 네트워크 인터페이스 IP 구성을 만들기 위한 서브넷 리소스에 대한 참조입니다.
|
type
|
string
|
하위 리소스 유형입니다.
|
IpTag
개체와 연결된 IpTag를 포함합니다.
Name |
형식 |
Description |
ipTagType
|
string
|
IP 태그 유형입니다. 예: FirstPartyUsage.
|
tag
|
string
|
공용 IP와 연결된 IP 태그의 값입니다. 예: SQL.
|
IPVersion
IP 주소 버전입니다.
Name |
형식 |
Description |
IPv4
|
string
|
|
IPv6
|
string
|
|
LoadBalancer
LoadBalancer 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
extendedLocation
|
ExtendedLocation
|
부하 분산 장치의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.backendAddressPools
|
BackendAddressPool[]
|
부하 분산 장치에서 사용하는 백 엔드 주소 풀의 컬렉션입니다.
|
properties.frontendIPConfigurations
|
FrontendIPConfiguration[]
|
부하 분산 장치에 사용할 프런트 엔드 IP를 나타내는 개체입니다.
|
properties.inboundNatPools
|
InboundNatPool[]
|
부하 분산 장치와 연결된 NIC의 단일 백 엔드 포트에 대한 인바운드 NAT의 외부 포트 범위를 정의합니다. 인바운드 NAT 규칙은 이 범위의 외부 포트를 사용하여 Load Balancer와 연결된 각 NIC에 대해 자동으로 만들어집니다. Load Balancer에서 인바운드 NAT 풀을 정의하는 것은 인바운드 NAT 규칙 정의와 함께 사용할 수 없습니다. 인바운드 NAT 풀은 가상 머신 확장 집합에서 참조됩니다. 개별 가상 머신과 연결된 NIC는 인바운드 NAT 풀을 참조할 수 없습니다. 개별 인바운드 NAT 규칙을 참조해야 합니다.
|
properties.inboundNatRules
|
InboundNatRule[]
|
부하 분산 장치에서 사용하는 인바운드 NAT 규칙의 컬렉션입니다. 부하 분산 장치에서 인바운드 NAT 규칙을 정의하는 것은 인바운드 NAT 풀 정의와 함께 사용할 수 없습니다. 인바운드 NAT 풀은 가상 머신 확장 집합에서 참조됩니다. 개별 가상 머신과 연결된 NIC는 인바운드 NAT 풀을 참조할 수 없습니다. 개별 인바운드 NAT 규칙을 참조해야 합니다.
|
properties.loadBalancingRules
|
LoadBalancingRule[]
|
부하 분산 규칙을 나타내는 개체 컬렉션은 프로비저닝을 가져옵니다.
|
properties.outboundRules
|
OutboundRule[]
|
아웃바운드 규칙입니다.
|
properties.probes
|
Probe[]
|
부하 분산 장치에 사용되는 프로브 개체의 컬렉션입니다.
|
properties.provisioningState
|
ProvisioningState
|
부하 분산 장치 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
부하 분산 장치 리소스의 리소스 GUID 속성입니다.
|
sku
|
LoadBalancerSku
|
부하 분산 장치 SKU입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
LoadBalancerBackendAddress
부하 분산 장치 백 엔드 주소.
Name |
형식 |
Description |
name
|
string
|
백 엔드 주소의 이름입니다.
|
properties.adminState
|
LoadBalancerBackendAddressAdminState
|
일단 설정된 관리 상태 목록은 Load Balancer가 항상 새 연결을 백 엔드로 전달하거나 새 연결을 거부하고 기존 연결을 다시 설정하도록 상태 프로브를 재정의할 수 있습니다.
|
properties.inboundNatRulesPortMapping
|
NatRulePortMapping[]
|
인바운드 NAT 규칙 포트 매핑의 컬렉션입니다.
|
properties.ipAddress
|
string
|
참조된 가상 네트워크에 속하는 IP 주소입니다.
|
properties.loadBalancerFrontendIPConfiguration
|
SubResource
|
지역 부하 분산 장치에 정의된 프런트 엔드 IP 주소 구성에 대한 참조입니다.
|
properties.networkInterfaceIPConfiguration
|
SubResource
|
네트워크 인터페이스에 정의된 IP 주소에 대한 참조입니다.
|
properties.subnet
|
SubResource
|
기존 서브넷에 대한 참조입니다.
|
properties.virtualNetwork
|
SubResource
|
기존 가상 네트워크에 대한 참조입니다.
|
LoadBalancerBackendAddressAdminState
일단 설정된 관리 상태 목록은 Load Balancer가 항상 새 연결을 백 엔드로 전달하거나 새 연결을 거부하고 기존 연결을 다시 설정하도록 상태 프로브를 재정의할 수 있습니다.
Name |
형식 |
Description |
Down
|
string
|
|
None
|
string
|
|
Up
|
string
|
|
LoadBalancerOutboundRuleProtocol
부하 분산 장치의 아웃바운드 규칙에 대한 프로토콜입니다.
Name |
형식 |
Description |
All
|
string
|
|
Tcp
|
string
|
|
Udp
|
string
|
|
LoadBalancerSku
부하 분산 장치의 SKU입니다.
LoadBalancerSkuName
부하 분산 장치 SKU의 이름입니다.
Name |
형식 |
Description |
Basic
|
string
|
|
Gateway
|
string
|
|
Standard
|
string
|
|
LoadBalancerSkuTier
부하 분산 장치 SKU의 계층입니다.
Name |
형식 |
Description |
Global
|
string
|
|
Regional
|
string
|
|
LoadBalancingRule
부하 분산 장치에 대한 부하 분산 규칙입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 부하 분산 규칙 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.backendAddressPool
|
SubResource
|
DIP 풀에 대한 참조입니다. 인바운드 트래픽은 백 엔드 IP의 IP 간에 임의로 부하 분산됩니다.
|
properties.backendAddressPools
|
SubResource[]
|
DIP 풀에 대한 참조 배열입니다.
|
properties.backendPort
|
integer
|
엔드포인트의 내부 연결에 사용되는 포트입니다. 허용되는 값은 0에서 65535 사이입니다. 값 0은 "모든 포트"를 사용하도록 설정합니다.
|
properties.disableOutboundSnat
|
boolean
|
부하 분산 규칙의 프런트 엔드에 지정된 publicIP 주소를 사용하도록 백 엔드 풀의 VM에 대한 SNAT를 구성합니다.
|
properties.enableFloatingIP
|
boolean
|
SQL AlwaysOn 가용성 그룹을 구성하는 데 필요한 부동 IP 기능에 대한 가상 머신의 엔드포인트를 구성합니다. 이 설정은 SQL Server에서 SQL AlwaysOn 가용성 그룹을 사용할 때 필요합니다. 엔드포인트를 만든 후에는 이 설정을 변경할 수 없습니다.
|
properties.enableTcpReset
|
boolean
|
TCP 흐름 유휴 시간 제한 또는 예기치 않은 연결 종료 시 양방향 TCP 재설정을 받습니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.frontendIPConfiguration
|
SubResource
|
프런트 엔드 IP 주소에 대한 참조입니다.
|
properties.frontendPort
|
integer
|
외부 엔드포인트의 포트입니다. 각 규칙의 포트 번호는 Load Balancer 내에서 고유해야 합니다. 허용되는 값은 0에서 65534 사이입니다. 값 0은 "모든 포트"를 사용하도록 설정합니다.
|
properties.idleTimeoutInMinutes
|
integer
|
TCP 유휴 연결에 대한 시간 제한입니다. 값은 4분에서 30분 사이로 설정할 수 있습니다. 기본값은 4분입니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.loadDistribution
|
LoadDistribution
|
이 규칙의 부하 분산 정책입니다.
|
properties.probe
|
SubResource
|
부하 분산 규칙에서 사용하는 부하 분산 장치 프로브에 대한 참조입니다.
|
properties.protocol
|
TransportProtocol
|
부하 분산 규칙에 사용되는 전송 프로토콜에 대한 참조입니다.
|
properties.provisioningState
|
ProvisioningState
|
부하 분산 규칙 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 유형입니다.
|
LoadDistribution
이 규칙의 부하 분산 정책입니다.
Name |
형식 |
Description |
Default
|
string
|
|
SourceIP
|
string
|
|
SourceIPProtocol
|
string
|
|
ManagedServiceIdentity
리소스의 ID입니다.
Name |
형식 |
Description |
principalId
|
string
|
시스템 할당 ID의 보안 주체 ID입니다. 이 속성은 시스템 할당 ID에 대해서만 제공됩니다.
|
tenantId
|
string
|
시스템 할당 ID의 테넌트 ID입니다. 이 속성은 시스템 할당 ID에 대해서만 제공됩니다.
|
type
|
ResourceIdentityType
|
리소스에 사용되는 ID의 형식입니다. 'SystemAssigned, UserAssigned' 형식에는 암시적으로 생성된 ID와 사용자 할당 ID 집합이 모두 포함됩니다. 'None' 형식은 가상 머신에서 모든 ID를 제거합니다.
|
userAssignedIdentities
|
UserAssignedIdentities
|
리소스와 연결된 사용자 ID 목록입니다. 사용자 ID 사전 키 참조는 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}' 형식의 ARM 리소스 ID입니다.
|
NatGateway
Nat 게이트웨이 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.idleTimeoutInMinutes
|
integer
|
nat 게이트웨이의 유휴 시간 제한입니다.
|
properties.provisioningState
|
ProvisioningState
|
NAT 게이트웨이 리소스의 프로비전 상태입니다.
|
properties.publicIpAddresses
|
SubResource[]
|
nat 게이트웨이 리소스와 연결된 공용 IP 주소의 배열입니다.
|
properties.publicIpPrefixes
|
SubResource[]
|
nat 게이트웨이 리소스와 연결된 공용 IP 접두사 배열입니다.
|
properties.resourceGuid
|
string
|
NAT 게이트웨이 리소스의 리소스 GUID 속성입니다.
|
properties.subnets
|
SubResource[]
|
이 nat 게이트웨이 리소스를 사용하는 서브넷에 대한 참조 배열입니다.
|
sku
|
NatGatewaySku
|
nat 게이트웨이 SKU입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
zones
|
string[]
|
Nat Gateway를 배포해야 하는 영역을 나타내는 가용성 영역 목록입니다.
|
NatGatewaySku
nat 게이트웨이의 SKU입니다.
NatGatewaySkuName
Nat Gateway SKU의 이름입니다.
Name |
형식 |
Description |
Standard
|
string
|
|
NatRulePortMapping
백 엔드 풀에 대해 만들어진 인바운드 NAT 규칙에 대한 개별 포트 매핑입니다.
Name |
형식 |
Description |
backendPort
|
integer
|
백 엔드 포트입니다.
|
frontendPort
|
integer
|
프런트 엔드 포트입니다.
|
inboundNatRuleName
|
string
|
인바운드 NAT 규칙의 이름입니다.
|
NetworkInterface
리소스 그룹의 네트워크 인터페이스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
extendedLocation
|
ExtendedLocation
|
네트워크 인터페이스의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.auxiliaryMode
|
NetworkInterfaceAuxiliaryMode
|
네트워크 인터페이스 리소스의 보조 모드입니다.
|
properties.auxiliarySku
|
NetworkInterfaceAuxiliarySku
|
네트워크 인터페이스 리소스의 보조 SKU입니다.
|
properties.defaultOutboundConnectivityEnabled
|
boolean
|
nic에 대한 기본 아웃바운드 연결이 구성되었는지 여부입니다.
|
properties.disableTcpStateTracking
|
boolean
|
tcp 상태 추적을 사용하지 않도록 설정할지 여부를 나타냅니다.
|
properties.dnsSettings
|
NetworkInterfaceDnsSettings
|
네트워크 인터페이스의 DNS 설정입니다.
|
properties.dscpConfiguration
|
SubResource
|
네트워크 인터페이스가 연결된 dscp 구성에 대한 참조입니다.
|
properties.enableAcceleratedNetworking
|
boolean
|
네트워크 인터페이스가 가속화된 네트워킹용으로 구성된 경우 가속화된 네트워킹이 필요한 VM 크기에는 적용되지 않습니다.
|
properties.enableIPForwarding
|
boolean
|
이 네트워크 인터페이스에서 IP 전달을 사용할 수 있는지 여부를 나타냅니다.
|
properties.hostedWorkloads
|
string[]
|
연결된 BareMetal 리소스에 대한 참조 목록입니다.
|
properties.ipConfigurations
|
NetworkInterfaceIPConfiguration[]
|
네트워크 인터페이스의 IP 구성 목록입니다.
|
properties.macAddress
|
string
|
네트워크 인터페이스의 MAC 주소입니다.
|
properties.migrationPhase
|
NetworkInterfaceMigrationPhase
|
네트워크 인터페이스 리소스의 마이그레이션 단계입니다.
|
properties.networkSecurityGroup
|
NetworkSecurityGroup
|
NetworkSecurityGroup 리소스에 대한 참조입니다.
|
properties.nicType
|
NetworkInterfaceNicType
|
네트워크 인터페이스 리소스의 유형입니다.
|
properties.primary
|
boolean
|
가상 머신의 기본 네트워크 인터페이스인지 여부입니다.
|
properties.privateEndpoint
|
PrivateEndpoint
|
네트워크 인터페이스가 연결된 프라이빗 엔드포인트에 대한 참조입니다.
|
properties.privateLinkService
|
PrivateLinkService
|
네트워크 인터페이스 리소스의 Privatelinkservice입니다.
|
properties.provisioningState
|
ProvisioningState
|
네트워크 인터페이스 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
네트워크 인터페이스 리소스의 리소스 GUID 속성입니다.
|
properties.tapConfigurations
|
NetworkInterfaceTapConfiguration[]
|
네트워크 인터페이스의 TapConfigurations 목록입니다.
|
properties.virtualMachine
|
SubResource
|
가상 머신에 대한 참조입니다.
|
properties.vnetEncryptionSupported
|
boolean
|
이 nic가 연결된 가상 머신이 암호화를 지원하는지 여부입니다.
|
properties.workloadType
|
string
|
BareMetal 리소스에 대한 NetworkInterface의 WorkloadType
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
NetworkInterfaceAuxiliaryMode
네트워크 인터페이스 리소스의 보조 모드입니다.
Name |
형식 |
Description |
AcceleratedConnections
|
string
|
|
Floating
|
string
|
|
MaxConnections
|
string
|
|
None
|
string
|
|
NetworkInterfaceAuxiliarySku
네트워크 인터페이스 리소스의 보조 SKU입니다.
Name |
형식 |
Description |
A1
|
string
|
|
A2
|
string
|
|
A4
|
string
|
|
A8
|
string
|
|
None
|
string
|
|
NetworkInterfaceDnsSettings
네트워크 인터페이스의 DNS 설정입니다.
Name |
형식 |
Description |
appliedDnsServers
|
string[]
|
이 NIC를 사용하는 VM이 가용성 집합의 일부인 경우 이 목록에는 가용성 집합의 일부인 모든 NIC의 모든 DNS 서버가 통합됩니다. 이 속성은 각 VM에서 구성됩니다.
|
dnsServers
|
string[]
|
DNS 서버 IP 주소 목록입니다. 'AzureProvidedDNS'를 사용하여 Azure 제공 DNS 확인으로 전환합니다. 'AzureProvidedDNS' 값은 다른 IP와 결합할 수 없으며 dnsServers 컬렉션에서 유일한 값이어야 합니다.
|
internalDnsNameLabel
|
string
|
동일한 가상 네트워크에 있는 VM 간의 내부 통신에 사용되는 이 NIC의 상대 DNS 이름입니다.
|
internalDomainNameSuffix
|
string
|
internalDnsNameLabel을 지정하지 않은 경우에도 VM의 기본 NIC에 대한 DNS 항목이 만들어집니다. 이 DNS 이름은 VM 이름을 internalDomainNameSuffix 값과 연결하여 생성할 수 있습니다.
|
internalFqdn
|
string
|
동일한 가상 네트워크에 있는 VM 간의 내부 통신을 지원하는 정규화된 DNS 이름입니다.
|
NetworkInterfaceIPConfiguration
네트워크 인터페이스의 IP 구성입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.applicationGatewayBackendAddressPools
|
ApplicationGatewayBackendAddressPool[]
|
ApplicationGatewayBackendAddressPool 리소스에 대한 참조입니다.
|
properties.applicationSecurityGroups
|
ApplicationSecurityGroup[]
|
IP 구성이 포함된 애플리케이션 보안 그룹입니다.
|
properties.gatewayLoadBalancer
|
SubResource
|
게이트웨이 부하 분산 장치 프런트 엔드 IP에 대한 참조입니다.
|
properties.loadBalancerBackendAddressPools
|
BackendAddressPool[]
|
LoadBalancerBackendAddressPool 리소스에 대한 참조입니다.
|
properties.loadBalancerInboundNatRules
|
InboundNatRule[]
|
LoadBalancerInboundNatRules 참조 목록입니다.
|
properties.primary
|
boolean
|
이것이 네트워크 인터페이스의 기본 고객 주소인지 여부입니다.
|
properties.privateIPAddress
|
string
|
IP 구성의 개인 IP 주소입니다. 형식의 단일 IP 주소 또는 CIDR 블록일 수 있습니다. /.
|
properties.privateIPAddressPrefixLength
|
integer
|
개인 IP 주소 접두사 길이입니다. 지정되고 할당 방법이 동적인 경우 서비스는 단일 IP 주소 대신 CIDR 블록을 할당합니다.
|
properties.privateIPAddressVersion
|
IPVersion
|
특정 IP 구성이 IPv4 또는 IPv6인지 여부입니다. 기본값은 IPv4입니다.
|
properties.privateIPAllocationMethod
|
IPAllocationMethod
|
개인 IP 주소 할당 방법입니다.
|
properties.privateLinkConnectionProperties
|
NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties
|
네트워크 인터페이스에 대한 PrivateLinkConnection 속성입니다.
|
properties.provisioningState
|
ProvisioningState
|
네트워크 인터페이스 IP 구성의 프로비전 상태입니다.
|
properties.publicIPAddress
|
PublicIPAddress
|
IP 구성에 바인딩된 공용 IP 주소입니다.
|
properties.subnet
|
Subnet
|
IP 구성에 바인딩된 서브넷입니다.
|
properties.virtualNetworkTaps
|
VirtualNetworkTap[]
|
Virtual Network 탭에 대한 참조입니다.
|
type
|
string
|
리소스 종류입니다.
|
NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties
네트워크 인터페이스에 대한 PrivateLinkConnection 속성입니다.
Name |
형식 |
Description |
fqdns
|
string[]
|
현재 프라이빗 링크 연결에 대한 FQDN 목록입니다.
|
groupId
|
string
|
현재 프라이빗 링크 연결의 그룹 ID입니다.
|
requiredMemberName
|
string
|
현재 프라이빗 링크 연결에 필요한 멤버 이름입니다.
|
NetworkInterfaceMigrationPhase
네트워크 인터페이스 리소스의 마이그레이션 단계입니다.
Name |
형식 |
Description |
Abort
|
string
|
|
Commit
|
string
|
|
Committed
|
string
|
|
None
|
string
|
|
Prepare
|
string
|
|
NetworkInterfaceNicType
네트워크 인터페이스 리소스의 유형입니다.
Name |
형식 |
Description |
Elastic
|
string
|
|
Standard
|
string
|
|
NetworkInterfaceTapConfiguration
네트워크 인터페이스에서 구성을 탭합니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.provisioningState
|
ProvisioningState
|
네트워크 인터페이스 탭 구성 리소스의 프로비전 상태입니다.
|
properties.virtualNetworkTap
|
VirtualNetworkTap
|
Virtual Network 탭 리소스에 대한 참조입니다.
|
type
|
string
|
하위 리소스 유형입니다.
|
NetworkSecurityGroup
NetworkSecurityGroup 리소스.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.defaultSecurityRules
|
SecurityRule[]
|
네트워크 보안 그룹의 기본 보안 규칙입니다.
|
properties.flowLogs
|
FlowLog[]
|
흐름 로그 리소스에 대한 참조 컬렉션입니다.
|
properties.flushConnection
|
boolean
|
사용하도록 설정하면 규칙이 업데이트될 때 네트워크 보안 그룹 연결에서 만든 흐름이 다시 평가됩니다. 초기 사용은 재평가를 트리거합니다.
|
properties.networkInterfaces
|
NetworkInterface[]
|
네트워크 인터페이스에 대한 참조 컬렉션입니다.
|
properties.provisioningState
|
ProvisioningState
|
네트워크 보안 그룹 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
네트워크 보안 그룹 리소스의 리소스 GUID 속성입니다.
|
properties.securityRules
|
SecurityRule[]
|
네트워크 보안 그룹의 보안 규칙 컬렉션입니다.
|
properties.subnets
|
Subnet[]
|
서브넷에 대한 참조 컬렉션입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
OutboundRule
부하 분산 장치의 아웃바운드 규칙입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 아웃바운드 규칙 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.allocatedOutboundPorts
|
integer
|
NAT에 사용할 아웃바운드 포트 수입니다.
|
properties.backendAddressPool
|
SubResource
|
DIP 풀에 대한 참조입니다. 아웃바운드 트래픽은 백 엔드 IP의 IP 간에 임의로 부하가 분산됩니다.
|
properties.enableTcpReset
|
boolean
|
TCP 흐름 유휴 시간 제한 또는 예기치 않은 연결 종료 시 양방향 TCP 재설정을 받습니다. 이 요소는 프로토콜이 TCP로 설정된 경우에만 사용됩니다.
|
properties.frontendIPConfigurations
|
SubResource[]
|
부하 분산 장치의 프런트 엔드 IP 주소입니다.
|
properties.idleTimeoutInMinutes
|
integer
|
TCP 유휴 연결에 대한 시간 제한입니다.
|
properties.protocol
|
LoadBalancerOutboundRuleProtocol
|
부하 분산 장치의 아웃바운드 규칙에 대한 프로토콜입니다.
|
properties.provisioningState
|
ProvisioningState
|
아웃바운드 규칙 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 유형입니다.
|
PrivateEndpoint
프라이빗 엔드포인트 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
extendedLocation
|
ExtendedLocation
|
부하 분산 장치의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.applicationSecurityGroups
|
ApplicationSecurityGroup[]
|
프라이빗 엔드포인트 IP 구성이 포함된 애플리케이션 보안 그룹입니다.
|
properties.customDnsConfigs
|
CustomDnsConfigPropertiesFormat[]
|
사용자 지정 dns 구성의 배열입니다.
|
properties.customNetworkInterfaceName
|
string
|
프라이빗 엔드포인트에 연결된 네트워크 인터페이스의 사용자 지정 이름입니다.
|
properties.ipConfigurations
|
PrivateEndpointIPConfiguration[]
|
프라이빗 엔드포인트의 IP 구성 목록입니다. 이는 자사 서비스의 엔드포인트에 매핑하는 데 사용됩니다.
|
properties.manualPrivateLinkServiceConnections
|
PrivateLinkServiceConnection[]
|
원격 리소스에 대한 연결에 대한 정보 그룹화입니다. 네트워크 관리자가 원격 리소스에 대한 연결을 승인할 수 있는 액세스 권한이 없는 경우에 사용됩니다.
|
properties.networkInterfaces
|
NetworkInterface[]
|
이 프라이빗 엔드포인트에 대해 만든 네트워크 인터페이스에 대한 참조 배열입니다.
|
properties.privateLinkServiceConnections
|
PrivateLinkServiceConnection[]
|
원격 리소스에 대한 연결에 대한 정보 그룹화입니다.
|
properties.provisioningState
|
ProvisioningState
|
프라이빗 엔드포인트 리소스의 프로비전 상태입니다.
|
properties.subnet
|
Subnet
|
개인 IP가 할당될 서브넷의 ID입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
PrivateEndpointConnection
PrivateEndpointConnection 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.linkIdentifier
|
string
|
소비자 링크 ID입니다.
|
properties.privateEndpoint
|
PrivateEndpoint
|
프라이빗 엔드포인트의 리소스입니다.
|
properties.privateEndpointLocation
|
string
|
프라이빗 엔드포인트의 위치입니다.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
서비스 소비자와 공급자 간의 연결 상태에 대한 정보 컬렉션입니다.
|
properties.provisioningState
|
ProvisioningState
|
프라이빗 엔드포인트 연결 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스 종류입니다.
|
PrivateEndpointIPConfiguration
프라이빗 엔드포인트의 IP 구성입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다.
|
properties.groupId
|
string
|
이 프라이빗 엔드포인트가 연결해야 하는 원격 리소스에서 가져온 그룹의 ID입니다.
|
properties.memberName
|
string
|
이 프라이빗 엔드포인트가 연결해야 하는 원격 리소스에서 가져온 그룹의 멤버 이름입니다.
|
properties.privateIPAddress
|
string
|
프라이빗 엔드포인트의 서브넷에서 가져온 개인 IP 주소입니다.
|
type
|
string
|
리소스 종류입니다.
|
PrivateLinkService
프라이빗 링크 서비스 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
extendedLocation
|
ExtendedLocation
|
부하 분산 장치의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.alias
|
string
|
프라이빗 링크 서비스의 별칭입니다.
|
properties.autoApproval
|
AutoApproval
|
프라이빗 링크 서비스의 자동 승인 목록입니다.
|
properties.destinationIPAddress
|
string
|
프라이빗 링크 서비스의 대상 IP 주소입니다.
|
properties.enableProxyProtocol
|
boolean
|
프라이빗 링크 서비스를 프록시 프로토콜에 사용할 수 있는지 여부입니다.
|
properties.fqdns
|
string[]
|
Fqdn 목록입니다.
|
properties.ipConfigurations
|
PrivateLinkServiceIpConfiguration[]
|
프라이빗 링크 서비스 IP 구성의 배열입니다.
|
properties.loadBalancerFrontendIpConfigurations
|
FrontendIPConfiguration[]
|
부하 분산 장치 IP 구성에 대한 참조 배열입니다.
|
properties.networkInterfaces
|
NetworkInterface[]
|
이 프라이빗 링크 서비스에 대해 만든 네트워크 인터페이스에 대한 참조 배열입니다.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
프라이빗 엔드포인트에 대한 연결에 대한 목록의 배열입니다.
|
properties.provisioningState
|
ProvisioningState
|
프라이빗 링크 서비스 리소스의 프로비전 상태입니다.
|
properties.visibility
|
Visibility
|
프라이빗 링크 서비스의 표시 유형 목록입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
PrivateLinkServiceConnection
PrivateLinkServiceConnection 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.groupIds
|
string[]
|
이 프라이빗 엔드포인트가 연결해야 하는 원격 리소스에서 가져온 그룹의 ID입니다.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
원격 리소스에 대한 연결 상태에 대한 읽기 전용 정보의 컬렉션입니다.
|
properties.privateLinkServiceId
|
string
|
프라이빗 링크 서비스의 리소스 ID입니다.
|
properties.provisioningState
|
ProvisioningState
|
프라이빗 링크 서비스 연결 리소스의 프로비전 상태입니다.
|
properties.requestMessage
|
string
|
이 연결 요청을 사용하여 원격 리소스의 소유자에게 전달된 메시지입니다. 140자로 제한됩니다.
|
type
|
string
|
리소스 종류입니다.
|
PrivateLinkServiceConnectionState
서비스 소비자와 공급자 간의 연결 상태에 대한 정보 컬렉션입니다.
Name |
형식 |
Description |
actionsRequired
|
string
|
서비스 공급자의 변경 내용에 소비자에 대한 업데이트가 필요한지 여부를 나타내는 메시지입니다.
|
description
|
string
|
연결의 승인/거부 이유입니다.
|
status
|
string
|
서비스 소유자가 연결을 승인/거부/제거했는지 여부를 나타냅니다.
|
PrivateLinkServiceIpConfiguration
프라이빗 링크 서비스 IP 구성입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
프라이빗 링크 서비스 IP 구성의 이름입니다.
|
properties.primary
|
boolean
|
IP 구성이 기본 구성인지 여부입니다.
|
properties.privateIPAddress
|
string
|
IP 구성의 개인 IP 주소입니다.
|
properties.privateIPAddressVersion
|
IPVersion
|
특정 IP 구성이 IPv4 또는 IPv6인지 여부입니다. 기본값은 IPv4입니다.
|
properties.privateIPAllocationMethod
|
IPAllocationMethod
|
개인 IP 주소 할당 방법입니다.
|
properties.provisioningState
|
ProvisioningState
|
프라이빗 링크 서비스 IP 구성 리소스의 프로비전 상태입니다.
|
properties.subnet
|
Subnet
|
서브넷 리소스에 대한 참조입니다.
|
type
|
string
|
리소스 종류입니다.
|
Probe
부하 분산 장치 프로브입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
부하 분산 장치에서 사용하는 프로브 집합 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.intervalInSeconds
|
integer
|
상태의 엔드포인트를 검색하는 빈도에 대한 간격(초)입니다. 일반적으로 간격은 인스턴스를 회전에서 제외하기 전에 두 개의 전체 프로브를 허용하는 할당된 시간 제한 기간(초)의 절반 미만입니다. 기본값은 15, 최소값은 5입니다.
|
properties.loadBalancingRules
|
SubResource[]
|
이 프로브를 사용하는 부하 분산 장치 규칙입니다.
|
properties.noHealthyBackendsBehavior
|
ProbeNoHealthyBackendsBehavior
|
모든 백 엔드 인스턴스를 검색할 때 부하 분산 장치에서 새 연결을 처리하는 방법을 결정합니다.
|
properties.numberOfProbes
|
integer
|
응답이 없으면 추가 트래픽이 엔드포인트로 전달되지 않도록 하는 프로브의 수입니다. 이 값을 사용하면 엔드포인트를 Azure에서 사용되는 일반적인 시간보다 더 빠르고 느리게 회전할 수 있습니다.
|
properties.port
|
integer
|
프로브를 통신하기 위한 포트입니다. 가능한 값의 범위는 1에서 65535까지입니다.
|
properties.probeThreshold
|
integer
|
트래픽이 이 엔드포인트로 배달되는 것을 허용하거나 거부하기 위해 연속 성공 또는 실패한 프로브의 수입니다. 이 값과 같은 연속 프로브의 수가 실패하면 엔드포인트가 회전에서 제거되고 동일한 수의 성공적인 연속 프로브가 회전에 다시 배치되어야 합니다.
|
properties.protocol
|
ProbeProtocol
|
엔드포인트의 프로토콜입니다. 'Tcp'를 지정하면 프로브가 성공하려면 수신된 ACK가 필요합니다. 'Http' 또는 'Https'를 지정하면 프로브가 성공하려면 지정된 URI의 200 OK 응답이 필요합니다.
|
properties.provisioningState
|
ProvisioningState
|
프로브 리소스의 프로비전 상태입니다.
|
properties.requestPath
|
string
|
VM에서 상태를 요청하는 데 사용되는 URI입니다. 프로토콜이 http로 설정된 경우 경로가 필요합니다. 그렇지 않으면 허용되지 않습니다. 기본값은 없습니다.
|
type
|
string
|
리소스의 유형입니다.
|
ProbeNoHealthyBackendsBehavior
모든 백 엔드 인스턴스를 검색할 때 부하 분산 장치에서 새 연결을 처리하는 방법을 결정합니다.
Name |
형식 |
Description |
AllProbedDown
|
string
|
백 엔드 풀에 새 흐름이 전송되지 않습니다.
|
AllProbedUp
|
string
|
모든 백 엔드 인스턴스가 검색되면 들어오는 패킷이 모든 인스턴스로 전송됩니다.
|
ProbeProtocol
엔드포인트의 프로토콜입니다. 'Tcp'를 지정하면 프로브가 성공하려면 수신된 ACK가 필요합니다. 'Http' 또는 'Https'를 지정하면 프로브가 성공하려면 지정된 URI의 200 OK 응답이 필요합니다.
Name |
형식 |
Description |
Http
|
string
|
|
Https
|
string
|
|
Tcp
|
string
|
|
ProvisioningState
현재 프로비저닝 상태입니다.
Name |
형식 |
Description |
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
PublicIPAddress
공용 IP 주소 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
extendedLocation
|
ExtendedLocation
|
공용 IP 주소의 확장된 위치입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.ddosSettings
|
DdosSettings
|
공용 IP 주소와 연결된 DDoS 보호 사용자 지정 정책입니다.
|
properties.deleteOption
|
DeleteOptions
|
공용 IP 주소를 사용하는 VM이 삭제될 때 발생하는 작업 지정
|
properties.dnsSettings
|
PublicIPAddressDnsSettings
|
공용 IP 주소와 연결된 DNS 레코드의 FQDN입니다.
|
properties.idleTimeoutInMinutes
|
integer
|
공용 IP 주소의 유휴 시간 제한입니다.
|
properties.ipAddress
|
string
|
공용 IP 주소 리소스와 연결된 IP 주소입니다.
|
properties.ipConfiguration
|
IPConfiguration
|
공용 IP 주소와 연결된 IP 구성입니다.
|
properties.ipTags
|
IpTag[]
|
공용 IP 주소와 연결된 태그 목록입니다.
|
properties.linkedPublicIPAddress
|
PublicIPAddress
|
공용 IP 주소 리소스의 연결된 공용 IP 주소입니다.
|
properties.migrationPhase
|
PublicIPAddressMigrationPhase
|
공용 IP 주소의 마이그레이션 단계입니다.
|
properties.natGateway
|
NatGateway
|
공용 IP 주소에 대한 NatGateway입니다.
|
properties.provisioningState
|
ProvisioningState
|
공용 IP 주소 리소스의 프로비전 상태입니다.
|
properties.publicIPAddressVersion
|
IPVersion
|
공용 IP 주소 버전입니다.
|
properties.publicIPAllocationMethod
|
IPAllocationMethod
|
공용 IP 주소 할당 방법입니다.
|
properties.publicIPPrefix
|
SubResource
|
이 공용 IP 주소가 할당되어야 하는 공용 IP 접두사입니다.
|
properties.resourceGuid
|
string
|
공용 IP 주소 리소스의 리소스 GUID 속성입니다.
|
properties.servicePublicIPAddress
|
PublicIPAddress
|
공용 IP 주소 리소스의 서비스 공용 IP 주소입니다.
|
sku
|
PublicIPAddressSku
|
공용 IP 주소 SKU입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
zones
|
string[]
|
리소스에 할당된 IP를 나타내는 가용성 영역의 목록입니다.
|
PublicIPAddressDnsSettings
공용 IP 주소와 연결된 DNS 레코드의 FQDN을 포함합니다.
Name |
형식 |
Description |
domainNameLabel
|
string
|
도메인 이름 레이블입니다. 도메인 이름 레이블과 지역화된 DNS 영역의 연결은 공용 IP 주소와 연결된 정규화된 도메인 이름을 구성합니다. 도메인 이름 레이블을 지정하면 Microsoft Azure DNS 시스템의 공용 IP에 대한 DNS 레코드가 만들어집니다.
|
domainNameLabelScope
|
PublicIpAddressDnsSettingsDomainNameLabelScope
|
도메인 이름 레이블 범위입니다. 도메인 이름 레이블 및 도메인 이름 레이블 범위를 지정하면 해시된 값이 FQDN에 포함된 Microsoft Azure DNS 시스템의 공용 IP에 대한 DNS 레코드가 만들어집니다.
|
fqdn
|
string
|
공용 IP와 연결된 DNS 레코드의 정규화된 도메인 이름입니다. domainNameLabel 및 지역화된 DNS 영역의 연결입니다.
|
reverseFqdn
|
string
|
역방향 FQDN입니다. 이 공용 IP 주소로 확인되는 사용자가 볼 수 있는 정규화된 도메인 이름입니다. reverseFqdn을 지정하면 in-addr.arpa 도메인의 IP 주소에서 역방향 FQDN으로 가리키는 PTR DNS 레코드가 만들어집니다.
|
PublicIpAddressDnsSettingsDomainNameLabelScope
도메인 이름 레이블 범위입니다. 도메인 이름 레이블 및 도메인 이름 레이블 범위를 지정하면 해시된 값이 FQDN에 포함된 Microsoft Azure DNS 시스템의 공용 IP에 대한 DNS 레코드가 만들어집니다.
Name |
형식 |
Description |
NoReuse
|
string
|
|
ResourceGroupReuse
|
string
|
|
SubscriptionReuse
|
string
|
|
TenantReuse
|
string
|
|
PublicIPAddressMigrationPhase
공용 IP 주소의 마이그레이션 단계입니다.
Name |
형식 |
Description |
Abort
|
string
|
|
Commit
|
string
|
|
Committed
|
string
|
|
None
|
string
|
|
Prepare
|
string
|
|
PublicIPAddressSku
공용 IP 주소의 SKU입니다.
PublicIPAddressSkuName
공용 IP 주소 SKU의 이름입니다.
Name |
형식 |
Description |
Basic
|
string
|
|
Standard
|
string
|
|
PublicIPAddressSkuTier
공용 IP 주소 SKU의 계층입니다.
Name |
형식 |
Description |
Global
|
string
|
|
Regional
|
string
|
|
ResourceIdentityType
리소스에 사용되는 ID의 형식입니다. 'SystemAssigned, UserAssigned' 형식에는 암시적으로 생성된 ID와 사용자 할당 ID 집합이 모두 포함됩니다. 'None' 형식은 가상 머신에서 모든 ID를 제거합니다.
Name |
형식 |
Description |
None
|
string
|
|
SystemAssigned
|
string
|
|
SystemAssigned, UserAssigned
|
string
|
|
UserAssigned
|
string
|
|
ResourceNavigationLink
ResourceNavigationLink 리소스.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 탐색 링크 식별자입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.link
|
string
|
외부 리소스에 연결합니다.
|
properties.linkedResourceType
|
string
|
연결된 리소스의 리소스 종류입니다.
|
properties.provisioningState
|
ProvisioningState
|
리소스 탐색 링크 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스 종류입니다.
|
RetentionPolicyParameters
흐름 로그에 대한 보존 정책을 정의하는 매개 변수입니다.
Name |
형식 |
Default value |
Description |
days
|
integer
|
0
|
흐름 로그 레코드를 보존할 일 수입니다.
|
enabled
|
boolean
|
False
|
보존을 사용/사용하지 않도록 설정하는 플래그입니다.
|
Route
리소스를 라우팅합니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.addressPrefix
|
string
|
경로가 적용되는 대상 CIDR입니다.
|
properties.hasBgpOverride
|
boolean
|
이 경로가 LPM에 관계없이 겹치는 BGP 경로를 재정의하는지 여부를 나타내는 값입니다.
|
properties.nextHopIpAddress
|
string
|
IP 주소 패킷을 전달해야 합니다. 다음 홉 값은 다음 홉 유형이 VirtualAppliance인 경로에서만 허용됩니다.
|
properties.nextHopType
|
RouteNextHopType
|
패킷을 보내야 하는 Azure 홉의 유형입니다.
|
properties.provisioningState
|
ProvisioningState
|
경로 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스의 형식입니다.
|
RouteNextHopType
패킷을 보내야 하는 Azure 홉의 유형입니다.
Name |
형식 |
Description |
Internet
|
string
|
|
None
|
string
|
|
VirtualAppliance
|
string
|
|
VirtualNetworkGateway
|
string
|
|
VnetLocal
|
string
|
|
RouteTable
경로 테이블 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.disableBgpRoutePropagation
|
boolean
|
해당 경로 테이블에서 BGP에서 학습한 경로를 사용하지 않도록 설정할지 여부입니다. True는 사용 안 함을 의미합니다.
|
properties.provisioningState
|
ProvisioningState
|
경로 테이블 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
경로 테이블의 리소스 GUID 속성입니다.
|
properties.routes
|
Route[]
|
경로 테이블 내에 포함된 경로의 컬렉션입니다.
|
properties.subnets
|
Subnet[]
|
서브넷에 대한 참조 컬렉션입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
SecurityRule
네트워크 보안 규칙.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.access
|
SecurityRuleAccess
|
네트워크 트래픽이 허용되거나 거부됩니다.
|
properties.description
|
string
|
이 규칙에 대한 설명입니다. 140자로 제한됩니다.
|
properties.destinationAddressPrefix
|
string
|
대상 주소 접두사입니다. CIDR 또는 대상 IP 범위입니다. 별표 '*'를 사용하여 모든 원본 IP를 일치시킬 수도 있습니다. 'VirtualNetwork', 'AzureLoadBalancer' 및 'Internet'과 같은 기본 태그도 사용할 수 있습니다.
|
properties.destinationAddressPrefixes
|
string[]
|
대상 주소 접두사입니다. CIDR 또는 대상 IP 범위.
|
properties.destinationApplicationSecurityGroups
|
ApplicationSecurityGroup[]
|
대상으로 지정된 애플리케이션 보안 그룹입니다.
|
properties.destinationPortRange
|
string
|
대상 포트 또는 범위입니다. 정수 또는 0에서 65535 사이의 범위입니다. 별표 '*'를 사용하여 모든 포트를 일치시킬 수도 있습니다.
|
properties.destinationPortRanges
|
string[]
|
대상 포트 범위입니다.
|
properties.direction
|
SecurityRuleDirection
|
규칙의 방향입니다. 이 방향은 들어오는 트래픽 또는 나가는 트래픽에 대해 규칙을 평가할지 여부를 지정합니다.
|
properties.priority
|
integer
|
규칙의 우선 순위입니다. 값은 100에서 4096 사이일 수 있습니다. 우선 순위 번호는 컬렉션의 각 규칙에 대해 고유해야 합니다. 우선 순위 수가 낮을수록 규칙의 우선 순위가 높습니다.
|
properties.protocol
|
SecurityRuleProtocol
|
이 규칙이 적용되는 네트워크 프로토콜입니다.
|
properties.provisioningState
|
ProvisioningState
|
보안 규칙 리소스의 프로비전 상태입니다.
|
properties.sourceAddressPrefix
|
string
|
CIDR 또는 원본 IP 범위입니다. 별표 '*'를 사용하여 모든 원본 IP를 일치시킬 수도 있습니다. 'VirtualNetwork', 'AzureLoadBalancer' 및 'Internet'과 같은 기본 태그도 사용할 수 있습니다. 수신 규칙인 경우 네트워크 트래픽이 시작되는 위치를 지정합니다.
|
properties.sourceAddressPrefixes
|
string[]
|
CIDR 또는 원본 IP 범위입니다.
|
properties.sourceApplicationSecurityGroups
|
ApplicationSecurityGroup[]
|
원본으로 지정된 애플리케이션 보안 그룹입니다.
|
properties.sourcePortRange
|
string
|
원본 포트 또는 범위입니다. 정수 또는 0에서 65535 사이의 범위입니다. 별표 '*'를 사용하여 모든 포트를 일치시킬 수도 있습니다.
|
properties.sourcePortRanges
|
string[]
|
원본 포트 범위입니다.
|
type
|
string
|
리소스의 형식입니다.
|
SecurityRuleAccess
네트워크 트래픽이 허용되는지 아니면 거부되는지 여부입니다.
Name |
형식 |
Description |
Allow
|
string
|
|
Deny
|
string
|
|
SecurityRuleDirection
규칙의 방향입니다. 이 방향은 들어오는 트래픽 또는 나가는 트래픽에 대해 규칙을 평가할지 여부를 지정합니다.
Name |
형식 |
Description |
Inbound
|
string
|
|
Outbound
|
string
|
|
SecurityRuleProtocol
이 규칙이 적용되는 네트워크 프로토콜입니다.
Name |
형식 |
Description |
*
|
string
|
|
Ah
|
string
|
|
Esp
|
string
|
|
Icmp
|
string
|
|
Tcp
|
string
|
|
Udp
|
string
|
|
ServiceAssociationLink
ServiceAssociationLink 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.allowDelete
|
boolean
|
true이면 리소스를 삭제할 수 있습니다.
|
properties.link
|
string
|
외부 리소스에 연결합니다.
|
properties.linkedResourceType
|
string
|
연결된 리소스의 리소스 종류입니다.
|
properties.locations
|
string[]
|
위치 목록입니다.
|
properties.provisioningState
|
ProvisioningState
|
서비스 연결 링크 리소스의 프로비전 상태입니다.
|
type
|
string
|
리소스 종류입니다.
|
ServiceEndpointPolicy
서비스 엔드포인트 정책 리소스입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
kind
|
string
|
서비스 엔드포인트 정책의 종류입니다. Azure Portal 환경에 사용되는 메타데이터입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.contextualServiceEndpointPolicies
|
string[]
|
컨텍스트 서비스 엔드포인트 정책의 컬렉션입니다.
|
properties.provisioningState
|
ProvisioningState
|
서비스 엔드포인트 정책 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
서비스 엔드포인트 정책 리소스의 리소스 GUID 속성입니다.
|
properties.serviceAlias
|
string
|
정책이 서비스에 속하는지 여부를 나타내는 별칭입니다.
|
properties.serviceEndpointPolicyDefinitions
|
ServiceEndpointPolicyDefinition[]
|
서비스 엔드포인트 정책의 서비스 엔드포인트 정책 정의 컬렉션입니다.
|
properties.subnets
|
Subnet[]
|
서브넷에 대한 참조 컬렉션입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
ServiceEndpointPolicyDefinition
서비스 엔드포인트 정책 정의입니다.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
name
|
string
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.description
|
string
|
이 규칙에 대한 설명입니다. 140자로 제한됩니다.
|
properties.provisioningState
|
ProvisioningState
|
서비스 엔드포인트 정책 정의 리소스의 프로비전 상태입니다.
|
properties.service
|
string
|
서비스 엔드포인트 이름입니다.
|
properties.serviceResources
|
string[]
|
서비스 리소스 목록입니다.
|
type
|
string
|
리소스의 형식입니다.
|
서비스 엔드포인트 속성입니다.
Name |
형식 |
Description |
locations
|
string[]
|
위치 목록입니다.
|
networkIdentifier
|
SubResource
|
네트워크 식별자로 SubResource.
|
provisioningState
|
ProvisioningState
|
서비스 엔드포인트 리소스의 프로비전 상태입니다.
|
service
|
string
|
엔드포인트 서비스의 형식입니다.
|
SharingScope
이 속성을 테넌트에 설정하여 AAD 테넌트에서 다른 구독과 서브넷을 공유할 수 있도록 합니다. defaultOutboundAccess가 false로 설정된 경우에만 이 속성을 설정할 수 있으며 서브넷이 비어 있는 경우에만 두 속성을 설정할 수 있습니다.
Name |
형식 |
Description |
DelegatedServices
|
string
|
|
Tenant
|
string
|
|
Subnet
가상 네트워크 리소스의 서브넷.
Name |
형식 |
Default value |
Description |
etag
|
string
|
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
|
리소스 ID입니다.
|
name
|
string
|
|
리소스 그룹 내에서 고유한 리소스의 이름입니다. 이 이름은 리소스에 액세스하는 데 사용할 수 있습니다.
|
properties.addressPrefix
|
string
|
|
서브넷의 주소 접두사입니다.
|
properties.addressPrefixes
|
string[]
|
|
서브넷에 대한 주소 접두사 목록입니다.
|
properties.applicationGatewayIPConfigurations
|
ApplicationGatewayIPConfiguration[]
|
|
가상 네트워크 리소스의 애플리케이션 게이트웨이 IP 구성
|
properties.defaultOutboundAccess
|
boolean
|
|
서브넷의 모든 VM에 대해 기본 아웃바운드 연결을 사용하지 않도록 설정하려면 이 속성을 false로 설정합니다. 이 속성은 서브넷을 만들 때만 설정할 수 있으며 기존 서브넷에 대해 업데이트할 수 없습니다.
|
properties.delegations
|
Delegation[]
|
|
서브넷의 위임에 대한 참조 배열입니다.
|
properties.ipAllocations
|
SubResource[]
|
|
이 서브넷을 참조하는 IpAllocation의 배열입니다.
|
properties.ipConfigurationProfiles
|
IPConfigurationProfile[]
|
|
이 서브넷을 참조하는 IP 구성 프로필의 배열입니다.
|
properties.ipConfigurations
|
IPConfiguration[]
|
|
서브넷을 사용하는 네트워크 인터페이스 IP 구성에 대한 참조 배열입니다.
|
properties.ipamPoolPrefixAllocations
|
IpamPoolPrefixAllocation[]
|
|
IP 주소 접두사를 할당하기 위한 IPAM 풀 목록입니다.
|
properties.natGateway
|
SubResource
|
|
이 서브넷과 연결된 Nat 게이트웨이입니다.
|
properties.networkSecurityGroup
|
NetworkSecurityGroup
|
|
NetworkSecurityGroup 리소스에 대한 참조입니다.
|
properties.privateEndpointNetworkPolicies
|
VirtualNetworkPrivateEndpointNetworkPolicies
|
Disabled
|
서브넷의 프라이빗 엔드포인트에 네트워크 정책 적용을 사용하거나 사용하지 않도록 설정합니다.
|
properties.privateEndpoints
|
PrivateEndpoint[]
|
|
프라이빗 엔드포인트에 대한 참조 배열입니다.
|
properties.privateLinkServiceNetworkPolicies
|
VirtualNetworkPrivateLinkServiceNetworkPolicies
|
Enabled
|
서브넷의 프라이빗 링크 서비스에 네트워크 정책 적용을 사용하거나 사용하지 않도록 설정합니다.
|
properties.provisioningState
|
ProvisioningState
|
|
서브넷 리소스의 프로비전 상태입니다.
|
properties.purpose
|
string
|
|
위임 및 기타 사용자 정의 속성을 기반으로 이 서브넷에 사용할 의도를 식별하는 읽기 전용 문자열입니다.
|
properties.resourceNavigationLinks
|
ResourceNavigationLink[]
|
|
서브넷을 사용하는 외부 리소스에 대한 참조 배열입니다.
|
properties.routeTable
|
RouteTable
|
|
RouteTable 리소스에 대한 참조입니다.
|
properties.serviceAssociationLinks
|
ServiceAssociationLink[]
|
|
이 서브넷에 삽입되는 서비스에 대한 참조 배열입니다.
|
properties.serviceEndpointPolicies
|
ServiceEndpointPolicy[]
|
|
서비스 엔드포인트 정책의 배열입니다.
|
properties.serviceEndpoints
|
ServiceEndpointPropertiesFormat[]
|
|
서비스 엔드포인트의 배열입니다.
|
properties.sharingScope
|
SharingScope
|
|
이 속성을 테넌트에 설정하여 AAD 테넌트에서 다른 구독과 서브넷을 공유할 수 있도록 합니다. defaultOutboundAccess가 false로 설정된 경우에만 이 속성을 설정할 수 있으며 서브넷이 비어 있는 경우에만 두 속성을 설정할 수 있습니다.
|
type
|
string
|
|
리소스 종류입니다.
|
SubResource
다른 하위 리소스에 대한 참조입니다.
Name |
형식 |
Description |
id
|
string
|
리소스 ID입니다.
|
SyncMode
백 엔드 풀에 대한 백 엔드 주소 동기 모드
Name |
형식 |
Description |
Automatic
|
string
|
|
Manual
|
string
|
|
TrafficAnalyticsConfigurationProperties
트래픽 분석의 구성을 정의하는 매개 변수입니다.
Name |
형식 |
Description |
enabled
|
boolean
|
트래픽 분석을 사용하거나 사용하지 않도록 설정하는 플래그입니다.
|
trafficAnalyticsInterval
|
integer
|
TA 서비스가 흐름 분석을 수행하는 빈도를 결정하는 간격(분)입니다.
|
workspaceId
|
string
|
연결된 작업 영역의 리소스 GUID입니다.
|
workspaceRegion
|
string
|
연결된 작업 영역의 위치입니다.
|
workspaceResourceId
|
string
|
연결된 작업 영역의 리소스 ID입니다.
|
TrafficAnalyticsProperties
트래픽 분석의 구성을 정의하는 매개 변수입니다.
TransportProtocol
엔드포인트에 대한 전송 프로토콜입니다.
Name |
형식 |
Description |
All
|
string
|
|
Tcp
|
string
|
|
Udp
|
string
|
|
UserAssignedIdentities
리소스와 연결된 사용자 ID 목록입니다. 사용자 ID 사전 키 참조는 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}' 형식의 ARM 리소스 ID입니다.
VirtualNetworkPrivateEndpointNetworkPolicies
서브넷의 프라이빗 엔드포인트에 네트워크 정책 적용을 사용하거나 사용하지 않도록 설정합니다.
Name |
형식 |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
NetworkSecurityGroupEnabled
|
string
|
|
RouteTableEnabled
|
string
|
|
VirtualNetworkPrivateLinkServiceNetworkPolicies
서브넷의 프라이빗 링크 서비스에 네트워크 정책 적용을 사용하거나 사용하지 않도록 설정합니다.
Name |
형식 |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
VirtualNetworkTap
Virtual Network 탭 리소스.
Name |
형식 |
Description |
etag
|
string
|
리소스를 업데이트할 때마다 변경되는 고유한 읽기 전용 문자열입니다.
|
id
|
string
|
리소스 ID입니다.
|
location
|
string
|
리소스 위치입니다.
|
name
|
string
|
리소스 이름입니다.
|
properties.destinationLoadBalancerFrontEndIPConfiguration
|
FrontendIPConfiguration
|
탭을 받을 내부 Load Balancer의 개인 IP 주소에 대한 참조입니다.
|
properties.destinationNetworkInterfaceIPConfiguration
|
NetworkInterfaceIPConfiguration
|
탭을 받을 수집기 nic의 개인 IP 주소에 대한 참조입니다.
|
properties.destinationPort
|
integer
|
탭된 트래픽을 수신할 VXLAN 대상 포트입니다.
|
properties.networkInterfaceTapConfigurations
|
NetworkInterfaceTapConfiguration[]
|
탭해야 하는 네트워크 인터페이스 IP 구성에 대한 리소스 ID 목록을 지정합니다.
|
properties.provisioningState
|
ProvisioningState
|
가상 네트워크 탭 리소스의 프로비전 상태입니다.
|
properties.resourceGuid
|
string
|
가상 네트워크 탭 리소스의 리소스 GUID 속성입니다.
|
tags
|
object
|
리소스 태그.
|
type
|
string
|
리소스 종류입니다.
|
Visibility
프라이빗 링크 서비스의 표시 유형 목록입니다.
Name |
형식 |
Description |
subscriptions
|
string[]
|
구독 목록입니다.
|