Reputation: 222582
I am trying to Create a Private DNS zone by specifying virtual network IDs with Powershell, and my command goes as follows,
New-AzDnsZone -Name 'dnszone01' -ResourceGroupName 'thisRG' -ZoneType 'Private' -RegistrationVirtualNetworkId @($vnet.Id)
I am getting an error as,
New-AzDnsZone : The zone name 'dnszone01' does not have enough labels. Zone names must have two or more labels. At line:1 char:1 + New-AzDnsZone -Name 'dnszone01' -ResourceGroupName 'thisRG' -Zon ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzDnsZone], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Dns.NewAzureDnsZone
what am I missing here?
Upvotes: 1
Views: 5528
Reputation: 21
Add .azure.com
to the name:
Example -
resource "azurerm_private_dns_zone" "dnszone" {
name = "${var.private_dns_zone_name}-pdz.postgres.database.azure.com"
resource_group_name = var.resource_group_name
Upvotes: 2
Reputation: 65391
The dns name must be fully qualifed. for example:
Upvotes: 12