Azure python funvtion with postgresql

Abhay Gupta 71 Reputation points
2022-04-15T14:16:36.01+00:00

Hi

Quick Question- Is psycopg3 supported for python azure function connecting to azure postgresql?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,214 questions
Azure Database for PostgreSQL
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Takahito Iwasa 4,851 Reputation points MVP
    2022-04-15T20:20:12.64+00:00

    Hi, @Abhay Gupta

    I think you can.
    However, connecting to PostgreSQL is not supported by the native binding feature, so you have to do everything from creating the connection to issuing the query yourself.

    First, Python on Azure Functions does not limit individual packages.
    You can set dependencies in requirements.txt and use local or remote builds to resolve the dependencies and deploy the package.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python

    And, as far as I can tell, psycopg3 is a non-special Python package.

    https://www.psycopg.org/psycopg3/docs/basic/install.html

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.