Hi,
I followed this blog: https://techcommunity.microsoft.com/t5/apps-on-azure-blog/how-to-connect-azure-sql-database-from-python-function-app-using/ba-p/3035595
using managed identity.
The main problem that I had is that I was connecting to an SQL database where I was not owner of and my Azure function (on Linux) couldn't make a connection to it. I coudn't solve this problem. I copied a part of the dataset in another SQL database where I am the owner of. I could connect to this database without any problems.
Kind regards