1👍
✅
Provided you have opened port 5432 on the VM, that would be the right string to connect to your database from anywhere. Have you tried to connect your development machine to this database?
If you have created your set-up with the new resource manager deployment model of azure, you should also be able to create both the web-app and the database VM within the same virtual network. This way, you can provide access to the database only for the Web App, and not for the entire internet.
Source:stackexchange.com