How to fix delayed TDS version error with pymssql when running backend app service

Jakob B 0 Reputation points
2024-03-06T22:24:10.2+00:00

I have an issue when deploying my python flask application, it connects to an azure db using pymssql. For about an hour after deployment, there are no issues and the flask server works as intended. However, after a bit this error starts to show up and any calls out to the db result in this error in the app logs. Not sure whats going on, in my code I am :

self.conn = pymssql.connect(
            server='*',
            user='*',
            password='*',
            database='*',
            as_dict=True,
            tds_version='7.3'
        )

to try and set the tds_version, but with or without setting this in the connect the error shows up after some amount of time.User's image

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
762 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,353 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,376 Reputation points Microsoft Employee
    2024-03-07T04:57:34.1633333+00:00

    Hi Jakob B,

    Welcome to Microsoft Q&A forum.

    As I understand, you want to know How to fix delayed TDS version error with pymssql when running backend app service.

    As per the screenshot and the error, it states that "stored procedures are not supported with a tds version less than 7".

    Try updating client library used for connection to SQL Server.

    Let us know if this helps.

    Thanks

    0 comments No comments