Azure Function Python V2 with bindings to Azure SQL Database

Louis Deconinck 0 Reputation points

I'm using Azure Functions V2 (Python 3.11). Here you can read that V2 replaces the function.json file with function decorators:

I would like to create a binding between my Azure Function and my Azure SQL database. This documentation explains how to do this, but it uses function.json (which is only available in Azure Functions Python V1 and not in the newer V2):

So my question is: How to create a binding between Azure Function Python V2 and Azure SQL Database?

Azure SQL Database
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,373 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 16,146 Reputation points

    Model V2 does not have function.json, bindings are defined inside the file. check this document

    Azure Functions expects a function to be a stateless method in your Python script that processes input and produces output. By default, the runtime expects the method to be implemented as a global method in the file. Triggers and bindings can be declared and used in a function in a decorator based approach. They're defined in the same file,, as the functions.

    0 comments No comments