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:
- 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.
- 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>%'
- 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>
- 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:
- 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
- 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