Understanding the ‘non-empty error’ when managing Azure Private DNS

When you are using Azure Private DNS and if you try to use a virtual network (VNet) that contains resources in it, you get this following error message: Set-AzDNSZone: Virtual networks that are non-empty (have Virtual Machines or other resources) are not allowed during association with a private zone.

The issue is easy to be reproduced by running these following cmdlets:

$VNet = Get-AzVirtualNetwork -Name <VirtualNetworkName> -ResourceGroupName <ResourceGroupName>
Set-AzDnsZone -Name <zonename.local> -ResourceGroupName <ResourceGroupName> -ResolutionVirtualNetworkID <NetworkID>

Azure DNS private

So what is this all about? There are a lot of comments around this Azure Private DNS issue on the Internet, and it is well-known in the public preview release. The Microsoft team is working on this problem toward the GA (General Availability) of the feature. More information can be found here.

The only workaround is to make sure that you configure the Azure Private DNS before adding servers to your virtual network. If you see a VNet with any entry on the connected devices, you will get the following error message.

Azure DNS private

Featured image: Shutterstock

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top