SOLVED – PostgreSQL Flexible Server PrivateDnsZoneHasWrongZoneSuffix
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.’
}
}
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.