Hi tugce tay •,
Welcome to Microsoft Q&A forum.
As I understand, for Postgis extension you are getting error: ERROR: extension "postgis" is not allow-listed for "azure_pg_admin" users in Azure Database for PostgreSQL.
Go to server parameter and search for azure extensions, select POSTGIS and save it as shown below:
After this try to perform your operation and see if that helps.
Thanks