After deleting a postgres flexible server the name is still taken

Jerome Bollinger 0 Reputation points
2024-07-16T08:22:34.9833333+00:00

After deleting a postgres flexible server, the server name remains unusable. The name is specific enough to assume no one else is using this name.

The server was setup in a Vnet thus creating an automatic private dns zone record. There might be a hint to the cause of this problem:

When using dig SERVER_NAME.postgres.database.azure.com the record still remains even though the server has been deleted. However, this DNS record is not visible in the records list of the private dns zone portal page.

This could mean that the reason for the unusable name could lie in the not fully deleted DNS record.

Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,481 Reputation points Microsoft Employee
    2024-07-16T09:56:55.11+00:00

    Hi Jerome Bollinger •,

    Welcome to Microsoft Q&A forum.

    As I understand, you are unable to create Azure Database for PostGreSQL Flexible server with the name of a deleted server.

    And even after using dig you could see that server shows deleted.

    I would recommend you to try Azure CLI/Powershell commands to check for DNS records in the relevant Private DNS Zone.

    If found, try deleting and retry creating server if works fine.

    Let us know how it goes.

    Thanks


  2. ShaktiSingh-MSFT 14,481 Reputation points Microsoft Employee
    2024-07-24T04:57:00.9966667+00:00

    Hi @Jerome Bollinger ,

    Thanks for your patience.

    Could you please try below and let us know if this helps:

    To fully remove any remnants of DNS records after deleting a PostgreSQL Flexible Server and ensure the server name becomes reusable, you can follow these steps:

    1. Check for Existing DNS Records:

    First, verify if the DNS records still exist for the deleted server. You can use the dig command to check for any remaining DNS records.

    1. Validate DNS Zone Information:

    Query the dbo.entity_azure_private_dns_zone table to validate whether the server is still associated with any private DNS zones.

    Example query:

    SELECT * FROM dbo.entity_azure_private_dns_zone

    WHERE associated_orcas_instance_id_list_json LIKE '%<server_instance_id>%'

    1. Remove DNS Records:

    If the server is still associated with a private DNS zone, you can use the Reset-PrivateDnsZone command to remove the DNS records.

    Example command:

    Reset-PrivateDnsZone -PrivateDnsZoneArmResourceId <private_dns_zone_resource_id> -ServerName <server_name>

    1. Verify Changes:

    After running the above command, verify the changes in the CMS by querying the dbo.entity_azure_private_dns_zone table again.

    Example query:

    SELECT * FROM dbo.entity_azure_private_dns_zone

    WHERE associated_orcas_instance_id_list_json LIKE '%<server_instance_id>%'

    Ensure Entity is in Succeeded State:

    1. Make sure the entity is in the "Succeeded" state. If not, use the request ID from the Reset-PrivateDnsZone command to check where it got stuck.

    If it got stuck at dropOldPrivateDnsRecord, use the following command to set the FSM to the "Completed" state:

    Set-OrcasBreadthFSMState -TableName tbl_operation_move_private_dns_zone -Keys <key> -ExpectedCurrentState DropOldPrivateDnsRecord -NewState Completed -CabId 123123 -Force

    1. Move Entity to Succeeded State:

    If the entity state is still "Moving" in the entity_azure_private_dns_zone table, move it to the "Succeeded" state by running the following command:

    Set-OrcasBreadthEntityState -TableName "entity_azure_private_dns_zone" -Keys <id_column_value> -ExpectedCurrentState Moving -NewState Succeeded -CabId 123123 -Force

    By following these steps, you should be able to fully remove any remnants of DNS records and ensure the server name becomes reusable.

    Awaiting your reply.

    Thanks

    0 comments No comments