Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzPrivateDnsVirtualNetworkLink

Creates a new private DNS virtual network link.

Syntax

VirtualNetworkId (Default)

New-AzPrivateDnsVirtualNetworkLink
 -ResourceGroupName <String>
 -ZoneName <String>
 -Name <String>
 -VirtualNetworkId <String>
 [-EnableRegistration]
 [-ResolutionPolicy <String>]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

VirtualNetworkObject

New-AzPrivateDnsVirtualNetworkLink
 -ResourceGroupName <String>
 -ZoneName <String>
 -Name <String>
 -VirtualNetwork <VirtualNetwork>
 [-EnableRegistration]
 [-ResolutionPolicy <String>]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

RemoteVirtualNetworkId

New-AzPrivateDnsVirtualNetworkLink
 -ResourceGroupName <String>
 -ZoneName <String>
 -Name <String>
 -RemoteVirtualNetworkId <String>
 [-EnableRegistration]
 [-ResolutionPolicy <String>]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

The New-AzPrivateDnsVirtualNetworkLink cmdlet creates a new private Domain Name System (DNS) virtual network link in the specified resource group and private zone. You must specify a unique link name for the Name parameter or the cmdlet will return an error. You can use the Confirm parameter and $ConfirmPreference Windows PowerShell variable to control whether the cmdlet prompts you for confirmation.

Examples

Example 1: Create a Private DNS virtual network link

$Link = New-AzPrivateDnsVirtualNetworkLink -ZoneName "myzone.com" -ResourceGroupName "MyResourceGroup" -Name "mylink" -VirtualNetworkId "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork" -EnableRegistration
Name : mylink
ResourceId : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.N
 etwork/privateDnsZones/myzone.com/virtualNetworkLinks/mylink
ResourceGroupName : MyResourceGroup
ZoneName : myzone.com
VirtualNetworkId : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.N
 etwork/virtualNetworks/myvirtualnetwork
Location :
Etag : "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Tags : {}
RegistrationEnabled : True
ResolutionPolicy : Default
VirtualNetworkLinkState : Completed
ProvisioningState : Succeeded

This command creates a new virtual network link associated with the private DNS zone named myzone.com and virtual network "myvirtualnetwork" (which has already been created in the resource group) in the specified resource group, and then stores it in the $Link variable.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-EnableRegistration

Switch parameter that represents if the link is registration enabled or not.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

Specifies the name of the virtual network link to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-RemoteVirtualNetworkId

The resource id of the virtual network in another tenant.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResolutionPolicy

Specifies the resolution policy of the virtual network link

Parameter properties

Type:PrivateDnsResolutionPolicy
Default value:Default
Accepted values:Default, NxDomainRedirect
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceGroupName

Specifies the resource group in which to create the link.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Tag

A hash table which represents resource tags.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-VirtualNetwork

The virtual network object associated with the link.

Parameter properties

Type:IVirtualNetwork
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-VirtualNetworkId

The resource id of the virtual network associated with the link.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

-ZoneName

Specifies the name of the zone which will be linked to the virtual network link.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

PSPrivateDnsVirtualNetworkLink

Related Links


Feedback

Was this page helpful?