How to find which Azure Private DNS Zone is associated with VNet

慈云数据 2024-04-10 技术支持 48 0

Here are some common scenarios in question:

How to find which Azure Private DNS Zone is associated with VNet
(图片来源网络,侵删)
  1. AzFW Goes into failed state due to a Private DNS zone linked with the VNET which causes resolution failures.
  2. Private Endpoint creation where dns zone fails to link to the vnet as another zone with the SAme NAME is already assigned.
  3. Trying to create vnet link in DNS zone and failing as there is another zone with the same name linked to the vnet.

Resolution:

You can leverage the below given ps scrIPt in order to find the zone names which have a link with the vnet in question:

How to find which Azure Private DNS Zone is associated with VNet
(图片来源网络,侵删)

Connect-AzAccount
Write-host"Here is a list of subscription available to you"Get-AzSubscription | format-table-property Subscriptionid, Name
$Subid= Read-Host"Enter the SubscriptionID you need to search the vnet link in"Connect-AzAccount -Subscription $subid$ResourceGroups= Get-AzResourceGroup
$ResourceGroupsNames= $ResourceGroups.ResourceGroupName
$VNETID=

微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon