At this moment, renaming an Azure Database for PostgreSQL Flexible Server directly is not supported. However, you can achieve the desired outcome by creating a new server with the preferred name and migrating your data or perform PITR. While restoring server, enter your server name without backup
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-restore-server-portal
let us know if you have any questions or need additional information.
Thank You!