1. Packages
  2. Azure Native v2
  3. API Docs
  4. network
  5. VirtualNetworkLink
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.network.VirtualNetworkLink

Explore with Pulumi AI

Describes a link to virtual network for a Private DNS zone. Azure REST API version: 2020-06-01. Prior API version in Azure Native 1.x: 2020-06-01.

Other available API versions: 2024-06-01.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var virtualNetworkLink = new AzureNative.Network.VirtualNetworkLink("virtualNetworkLink", new()
    {
        Location = "Global",
        PrivateZoneName = "privatezone1.com",
        RegistrationEnabled = false,
        ResourceGroupName = "resourceGroup1",
        Tags = 
        {
            { "key1", "value1" },
        },
        VirtualNetwork = new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName",
        },
        VirtualNetworkLinkName = "virtualNetworkLink1",
    });

});
Copy
package main

import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVirtualNetworkLink(ctx, "virtualNetworkLink", &network.VirtualNetworkLinkArgs{
			Location:            pulumi.String("Global"),
			PrivateZoneName:     pulumi.String("privatezone1.com"),
			RegistrationEnabled: pulumi.Bool(false),
			ResourceGroupName:   pulumi.String("resourceGroup1"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
			},
			VirtualNetwork: &network.SubResourceArgs{
				Id: pulumi.String("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
			},
			VirtualNetworkLinkName: pulumi.String("virtualNetworkLink1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.VirtualNetworkLink;
import com.pulumi.azurenative.network.VirtualNetworkLinkArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var virtualNetworkLink = new VirtualNetworkLink("virtualNetworkLink", VirtualNetworkLinkArgs.builder()
            .location("Global")
            .privateZoneName("privatezone1.com")
            .registrationEnabled(false)
            .resourceGroupName("resourceGroup1")
            .tags(Map.of("key1", "value1"))
            .virtualNetwork(SubResourceArgs.builder()
                .id("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName")
                .build())
            .virtualNetworkLinkName("virtualNetworkLink1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const virtualNetworkLink = new azure_native.network.VirtualNetworkLink("virtualNetworkLink", {
    location: "Global",
    privateZoneName: "privatezone1.com",
    registrationEnabled: false,
    resourceGroupName: "resourceGroup1",
    tags: {
        key1: "value1",
    },
    virtualNetwork: {
        id: "/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName",
    },
    virtualNetworkLinkName: "virtualNetworkLink1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

virtual_network_link = azure_native.network.VirtualNetworkLink("virtualNetworkLink",
    location="Global",
    private_zone_name="privatezone1.com",
    registration_enabled=False,
    resource_group_name="resourceGroup1",
    tags={
        "key1": "value1",
    },
    virtual_network={
        "id": "/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName",
    },
    virtual_network_link_name="virtualNetworkLink1")
Copy
resources:
  virtualNetworkLink:
    type: azure-native:network:VirtualNetworkLink
    properties:
      location: Global
      privateZoneName: privatezone1.com
      registrationEnabled: false
      resourceGroupName: resourceGroup1
      tags:
        key1: value1
      virtualNetwork:
        id: /subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName
      virtualNetworkLinkName: virtualNetworkLink1
Copy

Create VirtualNetworkLink Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VirtualNetworkLink(name: string, args: VirtualNetworkLinkArgs, opts?: CustomResourceOptions);
@overload
def VirtualNetworkLink(resource_name: str,
                       args: VirtualNetworkLinkArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def VirtualNetworkLink(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       private_zone_name: Optional[str] = None,
                       resource_group_name: Optional[str] = None,
                       location: Optional[str] = None,
                       registration_enabled: Optional[bool] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       virtual_network: Optional[SubResourceArgs] = None,
                       virtual_network_link_name: Optional[str] = None)
func NewVirtualNetworkLink(ctx *Context, name string, args VirtualNetworkLinkArgs, opts ...ResourceOption) (*VirtualNetworkLink, error)
public VirtualNetworkLink(string name, VirtualNetworkLinkArgs args, CustomResourceOptions? opts = null)
public VirtualNetworkLink(String name, VirtualNetworkLinkArgs args)
public VirtualNetworkLink(String name, VirtualNetworkLinkArgs args, CustomResourceOptions options)
type: azure-native:network:VirtualNetworkLink
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VirtualNetworkLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VirtualNetworkLinkArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VirtualNetworkLinkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VirtualNetworkLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VirtualNetworkLinkArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var virtualNetworkLinkResource = new AzureNative.Network.VirtualNetworkLink("virtualNetworkLinkResource", new()
{
    PrivateZoneName = "string",
    ResourceGroupName = "string",
    Location = "string",
    RegistrationEnabled = false,
    Tags = 
    {
        { "string", "string" },
    },
    VirtualNetwork = 
    {
        { "id", "string" },
    },
    VirtualNetworkLinkName = "string",
});
Copy
example, err := network.NewVirtualNetworkLink(ctx, "virtualNetworkLinkResource", &network.VirtualNetworkLinkArgs{
	PrivateZoneName:     "string",
	ResourceGroupName:   "string",
	Location:            "string",
	RegistrationEnabled: false,
	Tags: map[string]interface{}{
		"string": "string",
	},
	VirtualNetwork: map[string]interface{}{
		"id": "string",
	},
	VirtualNetworkLinkName: "string",
})
Copy
var virtualNetworkLinkResource = new VirtualNetworkLink("virtualNetworkLinkResource", VirtualNetworkLinkArgs.builder()
    .privateZoneName("string")
    .resourceGroupName("string")
    .location("string")
    .registrationEnabled(false)
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .virtualNetwork(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .virtualNetworkLinkName("string")
    .build());
Copy
virtual_network_link_resource = azure_native.network.VirtualNetworkLink("virtualNetworkLinkResource",
    private_zone_name=string,
    resource_group_name=string,
    location=string,
    registration_enabled=False,
    tags={
        string: string,
    },
    virtual_network={
        id: string,
    },
    virtual_network_link_name=string)
Copy
const virtualNetworkLinkResource = new azure_native.network.VirtualNetworkLink("virtualNetworkLinkResource", {
    privateZoneName: "string",
    resourceGroupName: "string",
    location: "string",
    registrationEnabled: false,
    tags: {
        string: "string",
    },
    virtualNetwork: {
        id: "string",
    },
    virtualNetworkLinkName: "string",
});
Copy
type: azure-native:network:VirtualNetworkLink
properties:
    location: string
    privateZoneName: string
    registrationEnabled: false
    resourceGroupName: string
    tags:
        string: string
    virtualNetwork:
        id: string
    virtualNetworkLinkName: string
Copy

VirtualNetworkLink Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VirtualNetworkLink resource accepts the following input properties:

PrivateZoneName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Private DNS zone (without a terminating dot).
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Location Changes to this property will trigger replacement. string
The Azure Region where the resource lives
RegistrationEnabled bool
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
Tags Dictionary<string, string>
Resource tags.
VirtualNetwork Pulumi.AzureNative.Network.Inputs.SubResource
The reference of the virtual network.
VirtualNetworkLinkName Changes to this property will trigger replacement. string
The name of the virtual network link.
PrivateZoneName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Private DNS zone (without a terminating dot).
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
Location Changes to this property will trigger replacement. string
The Azure Region where the resource lives
RegistrationEnabled bool
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
Tags map[string]string
Resource tags.
VirtualNetwork SubResourceArgs
The reference of the virtual network.
VirtualNetworkLinkName Changes to this property will trigger replacement. string
The name of the virtual network link.
privateZoneName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Private DNS zone (without a terminating dot).
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
location Changes to this property will trigger replacement. String
The Azure Region where the resource lives
registrationEnabled Boolean
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
tags Map<String,String>
Resource tags.
virtualNetwork SubResource
The reference of the virtual network.
virtualNetworkLinkName Changes to this property will trigger replacement. String
The name of the virtual network link.
privateZoneName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Private DNS zone (without a terminating dot).
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
location Changes to this property will trigger replacement. string
The Azure Region where the resource lives
registrationEnabled boolean
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
tags {[key: string]: string}
Resource tags.
virtualNetwork SubResource
The reference of the virtual network.
virtualNetworkLinkName Changes to this property will trigger replacement. string
The name of the virtual network link.
private_zone_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Private DNS zone (without a terminating dot).
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
location Changes to this property will trigger replacement. str
The Azure Region where the resource lives
registration_enabled bool
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
tags Mapping[str, str]
Resource tags.
virtual_network SubResourceArgs
The reference of the virtual network.
virtual_network_link_name Changes to this property will trigger replacement. str
The name of the virtual network link.
privateZoneName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Private DNS zone (without a terminating dot).
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
location Changes to this property will trigger replacement. String
The Azure Region where the resource lives
registrationEnabled Boolean
Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
tags Map<String>
Resource tags.
virtualNetwork Property Map
The reference of the virtual network.
virtualNetworkLinkName Changes to this property will trigger replacement. String
The name of the virtual network link.

Outputs

All input properties are implicitly available as output properties. Additionally, the VirtualNetworkLink resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
ProvisioningState string
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
Type string
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
VirtualNetworkLinkState string
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
Etag string
The ETag of the virtual network link.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
ProvisioningState string
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
Type string
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
VirtualNetworkLinkState string
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
Etag string
The ETag of the virtual network link.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
provisioningState String
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
type String
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
virtualNetworkLinkState String
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
etag String
The ETag of the virtual network link.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
provisioningState string
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
type string
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
virtualNetworkLinkState string
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
etag string
The ETag of the virtual network link.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
provisioning_state str
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
type str
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
virtual_network_link_state str
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
etag str
The ETag of the virtual network link.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
provisioningState String
The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.
type String
The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
virtualNetworkLinkState String
The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.
etag String
The ETag of the virtual network link.

Supporting Types

SubResource
, SubResourceArgs

Id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
Id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id String
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id string
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id str
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
id String
Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.

SubResourceResponse
, SubResourceResponseArgs

Id This property is required. string
Resource ID.
Id This property is required. string
Resource ID.
id This property is required. String
Resource ID.
id This property is required. string
Resource ID.
id This property is required. str
Resource ID.
id This property is required. String
Resource ID.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:VirtualNetworkLink virtualNetworkLink1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0