File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,13 @@ async def get_azure_sql_connection():
106106 conn = pyodbc .connect (connection_string , attrs_before = {SQL_COPT_SS_ACCESS_TOKEN : token_struct })
107107 return conn
108108 except Exception :
109- connection_string = f"DRIVER={{{ driver17 } }};SERVER={ sql_server } ;DATABASE={ sql_database } ;"
110- conn = pyodbc .connect (connection_string , attrs_before = {SQL_COPT_SS_ACCESS_TOKEN : token_struct })
111- return conn
109+ try :
110+ connection_string = f"DRIVER={{{ driver17 } }};SERVER={ sql_server } ;DATABASE={ sql_database } ;"
111+ conn = pyodbc .connect (connection_string , attrs_before = {SQL_COPT_SS_ACCESS_TOKEN : token_struct })
112+ return conn
113+ except Exception as e :
114+ logging .info ("AZURE-SQL: Failed to connect to Azure SQL Database: %s" , e )
115+ return None
112116
113117
114118async def get_fabric_db_connection ():
You can’t perform that action at this time.
0 commit comments