I need to connect Azure Sql Db from Python Azure Function. Azure SQL is linked with Azure account(A) and Python Azure function is linked with another account(B). I am able to fetch data from within same account(B) Sql DB from Python Azure Function but when i am trying to create connection with sql db of other Azure Account(A) from Account(B), it is giving me the error. What i tried: server = "XXXX.database.windows.net" database = "KDSKDNK" username = "ABC" password = "##$%fJNSK" cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password) cursor = cnxn.cursor() driver = 'ODBC Driver 17 for SQL Server' DATABASE_CONNECTION = f'mssql://{username}:{password}@{server}/{database}?driver={driver}' engine = create_engine(DATABASE_CONNECTION,fast_executemany = True) connection = engine.connect() The above code is working fine for the sql database which is in the same account(B) but it not working for azure account(A) DB. Error: ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes (https://learn.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://learn.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database). (47073) (SQLDriverConnect)'). Continue reading...