RehanAhmad25 commented on code in PR #74539:
URL: https://github.com/apache/airflow/pull/74539#discussion_r4627590831


##########
providers/microsoft/mssql/docs/connections/mssql.rst:
##########
@@ -74,3 +74,60 @@ If serializing with JSON:
         "port": 1433,
         "schema": "database_name"
     }'
+
+Choosing the DBAPI driver
+-------------------------
+
+By default the hook connects with `pymssql 
<https://pypi.org/project/pymssql/>`__. Microsoft's own
+`mssql-python <https://pypi.org/project/mssql-python/>`__ driver is available 
as an alternative. Compared
+with pymssql it supports Microsoft Entra ID authentication, and it uses 
Microsoft's ODBC driver (installed
+with it) instead of FreeTDS. Switching changes a few things, which are listed 
in the notes below. For
+example, SQL written with ``%s`` placeholders has to be rewritten to use ``?``.
+
+To use it, install the extra:
+
+.. code-block:: bash
+
+    pip install 'apache-airflow-providers-microsoft-mssql[mssql-python]'
+
+and set ``dbapi_driver`` to ``mssql_python`` in the connection extra. As a 
URI, the extras go in as query parameters:
+
+.. code-block:: bash
+
+    export 
AIRFLOW_CONN_MSSQL_DEFAULT='mssql://username:[email protected]:1433/database_name?dbapi_driver=mssql_python&TrustServerCertificate=yes'

Review Comment:
   Good point, switched to `example.com`.



##########
providers/microsoft/mssql/docs/connections/mssql.rst:
##########
@@ -74,3 +74,60 @@ If serializing with JSON:
         "port": 1433,
         "schema": "database_name"
     }'
+
+Choosing the DBAPI driver
+-------------------------
+
+By default the hook connects with `pymssql 
<https://pypi.org/project/pymssql/>`__. Microsoft's own
+`mssql-python <https://pypi.org/project/mssql-python/>`__ driver is available 
as an alternative. Compared
+with pymssql it supports Microsoft Entra ID authentication, and it uses 
Microsoft's ODBC driver (installed
+with it) instead of FreeTDS. Switching changes a few things, which are listed 
in the notes below. For
+example, SQL written with ``%s`` placeholders has to be rewritten to use ``?``.
+
+To use it, install the extra:
+
+.. code-block:: bash
+
+    pip install 'apache-airflow-providers-microsoft-mssql[mssql-python]'
+
+and set ``dbapi_driver`` to ``mssql_python`` in the connection extra. As a 
URI, the extras go in as query parameters:
+
+.. code-block:: bash
+
+    export 
AIRFLOW_CONN_MSSQL_DEFAULT='mssql://username:[email protected]:1433/database_name?dbapi_driver=mssql_python&TrustServerCertificate=yes'
+
+If serializing with JSON:
+
+
+.. code-block:: bash
+
+    export AIRFLOW_CONN_MSSQL_DEFAULT='{
+        "conn_type": "mssql",
+        "login": "username",
+        "password": "password",
+        "host": "server.com",

Review Comment:
   Switched to `example.com`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to