For scenario 1 You will need to install the postgres_fdw extensions. https://learn.microsoft.com/en-us/azure/postgresql/concepts-extensions#dblink-and-postgres_fdw
make sure Allow access to Azure services" to ON
Does not apply for scenario 2
Please let me know if you have further queries
Regards,
Oury