Hi, @Uday Kiran Reddy (ureddy) Thanks for the ask and using the Microsoft Q&A platform.
As we understand the ask here is on how to change azure Postgres flexible server from public to private vnet and private to public, please do let me know if that is not accurate.
Here we have a limitation on changing Private to Public check the documentation for reference.
The option here is you need to dump and restore,
Regards
Geetha