SOLVED – PostgreSQL Flexible Server PrivateDnsZoneHasWrongZoneSuffix

Advertisement

Problem – I’m trying to deploy a DBforPostgreSQL/flexibleServers with private DNS in a vnet.
Following the guide here on Azure Portal, everything works as expected. Now I’m trying to replicate this using a bicep file, and when deploying from the azure cli, I get this error

{
‘status’: ‘Failed’,
‘error’: {
‘code’: ‘PrivateDnsZoneHasWrongZoneSuffix’,
‘message’: ‘The Private DNS Zone name provided is not valid. It has to end with my-database.’
}
}

sample bicep file

You May Also Like: SOLVED – How To Get All Data From Last 5 Minutes in SQL

SOLUTION

You will need to create your Private DNS Zone without my-database. This should be your name: private.postgres.database.azure.com

resource dnsZone ‘Microsoft.Network/privateDnsZones@2020-06-01’ = {
name: ‘private.postgres.database.azure.com
location: ‘global’

DB server name should be your A record which you will need to create later.

You May Also Like: SOLVED – How To Update Connection Policy Of Synapse Dedicated SQL Pools

We hope the solutions in the above-mentioned article were helpful. Feel free to share your views with us.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>