Local Network Gateways - Create Or Update

Creates or updates a local network gateway in the specified resource group.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}?api-version=2023-09-01

URI Parameters

Name In Required Type Description
localNetworkGatewayName
path True

string

The name of the local network gateway.

resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Client API version.

Request Body

Name Type Description
id

string

Resource ID.

location

string

Resource location.

properties.bgpSettings

BgpSettings

Local network gateway's BGP speaker settings.

properties.fqdn

string

FQDN of local network gateway.

properties.gatewayIpAddress

string

IP address of local network gateway.

properties.localNetworkAddressSpace

AddressSpace

Local network site address space.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

LocalNetworkGateway

Update successful. The operation returns the resulting LocalNetworkGateway resource.

201 Created

LocalNetworkGateway

Create successful. The operation returns the resulting LocalNetworkGateway resource.

Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

CreateLocalNetworkGateway

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw?api-version=2023-09-01

{
  "properties": {
    "localNetworkAddressSpace": {
      "addressPrefixes": [
        "10.1.0.0/16"
      ]
    },
    "gatewayIpAddress": "11.12.13.14",
    "fqdn": "site1.contoso.com"
  },
  "location": "Central US"
}

Sample Response

{
  "name": "localgw",
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw",
  "etag": "W/\"00000000-0000-0000-0000-000000000000\"",
  "type": "Microsoft.Network/localNetworkGateways",
  "location": "centralus",
  "properties": {
    "provisioningState": "Updating",
    "resourceGuid": "00000000-0000-0000-0000-000000000000",
    "localNetworkAddressSpace": {
      "addressPrefixes": [
        "10.1.0.0/16"
      ]
    },
    "gatewayIpAddress": "11.12.13.14"
  }
}
{
  "name": "localgw",
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw",
  "etag": "W/\"00000000-0000-0000-0000-000000000000\"",
  "type": "Microsoft.Network/localNetworkGateways",
  "location": "centralus",
  "properties": {
    "provisioningState": "Updating",
    "resourceGuid": "00000000-0000-0000-0000-000000000000",
    "localNetworkAddressSpace": {
      "addressPrefixes": [
        "10.1.0.0/16"
      ]
    },
    "gatewayIpAddress": "11.12.13.14"
  }
}

Definitions

Name Description
AddressSpace

AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network.

BgpSettings

BGP settings details.

CloudError

An error response from the service.

CloudErrorBody

An error response from the service.

IPConfigurationBgpPeeringAddress

Properties of IPConfigurationBgpPeeringAddress.

LocalNetworkGateway

A common class for general resource information.

ProvisioningState

The current provisioning state.

AddressSpace

AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network.

Name Type Description
addressPrefixes

string[]

A list of address blocks reserved for this virtual network in CIDR notation.

BgpSettings

BGP settings details.

Name Type Description
asn

integer

The BGP speaker's ASN.

bgpPeeringAddress

string

The BGP peering address and BGP identifier of this BGP speaker.

bgpPeeringAddresses

IPConfigurationBgpPeeringAddress[]

BGP peering address with IP configuration ID for virtual network gateway.

peerWeight

integer

The weight added to routes learned from this BGP speaker.

CloudError

An error response from the service.

Name Type Description
error

CloudErrorBody

Cloud error body.

CloudErrorBody

An error response from the service.

Name Type Description
code

string

An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

details

CloudErrorBody[]

A list of additional details about the error.

message

string

A message describing the error, intended to be suitable for display in a user interface.

target

string

The target of the particular error. For example, the name of the property in error.

IPConfigurationBgpPeeringAddress

Properties of IPConfigurationBgpPeeringAddress.

Name Type Description
customBgpIpAddresses

string[]

The list of custom BGP peering addresses which belong to IP configuration.

defaultBgpIpAddresses

string[]

The list of default BGP peering addresses which belong to IP configuration.

ipconfigurationId

string

The ID of IP configuration which belongs to gateway.

tunnelIpAddresses

string[]

The list of tunnel public IP addresses which belong to IP configuration.

LocalNetworkGateway

A common class for general resource information.

Name Type Description
etag

string

A unique read-only string that changes whenever the resource is updated.

id

string

Resource ID.

location

string

Resource location.

name

string

Resource name.

properties.bgpSettings

BgpSettings

Local network gateway's BGP speaker settings.

properties.fqdn

string

FQDN of local network gateway.

properties.gatewayIpAddress

string

IP address of local network gateway.

properties.localNetworkAddressSpace

AddressSpace

Local network site address space.

properties.provisioningState

ProvisioningState

The provisioning state of the local network gateway resource.

properties.resourceGuid

string

The resource GUID property of the local network gateway resource.

tags

object

Resource tags.

type

string

Resource type.

ProvisioningState

The current provisioning state.

Name Type Description
Deleting

string

Failed

string

Succeeded

string

Updating

string