Hi Oury,
Our problem is solved. Thank you very much!
regards,
Kaat
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have created an Azure function (in Python). Within that function I want to do a query from a MS SQL server. I make a connection with the following code:
server = 'myserver,port_nr'
database = 'Application'
Authentication='ActiveDirectoryMsi'
driver= '{ODBC Driver 17 for SQL Server}'
conn_sleep = pyodbc.connect('DRIVER='+driver+
';SERVER='+server+
';PORT=1433;DATABASE='+database+
';AUTHENTICATION='+Authentication
)
It gives me this error: Result: Failure Exception: OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)') Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py",
Does someone has a suggestion to solve it?
Kind regards,
Kaat
Hi Oury,
Our problem is solved. Thank you very much!
regards,
Kaat
Connect Azure SQL database from Python Function App using managed identity or access token.
refer this blog
------
If this answers your query, do click Accept Answer
and Up-Vote for the same. And, if you have any further query do let us know.
I would suggest following the blog shared by @SUNOJ KUMAR YELURU below. It covers the step by step on how to connect Azure SQL Database from Python function App using managed Identity or access token.
Please let us know if that helps or shared the steps you took when trying to connect.
Regards,
Oury
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