From 9f4f8b3553ea02e021712b893d9d076f9c9b5e11 Mon Sep 17 00:00:00 2001 From: Dikarabo-Molele Date: Fri, 16 Feb 2024 01:11:41 +0200 Subject: [PATCH] Add environment var example to mssql.rst (#37418) * Add environment var example to mssql.rst Adding example code for configuring MSSQL connection using environment variables for easier reference. * Update mssql.rst to add JSON serializing example Update mssql.rst to add JSON serializing example * Update docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst Remove unnecessary .. Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Update docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst Remove unnecessary .. Co-authored-by: Wei Lee --------- Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> Co-authored-by: Wei Lee --- .../connections/mssql.rst | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst b/docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst index 9e66429044b04..a2990742aea93 100644 --- a/docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst +++ b/docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst @@ -51,3 +51,26 @@ Extra (optional) More details on all MSSQL parameters supported can be found in `MSSQL documentation `_. + +When specifying the connection as URI (in :envvar:`AIRFLOW_CONN_{CONN_ID}` variable) you should specify it +following the standard syntax of DB connections - where extras are passed as parameters +of the URI. Note that all components of the URI should be URL-encoded. + +For example: + +.. code-block:: bash + + export AIRFLOW_CONN_MSSQL_DEFAULT='mssql://username:password@server.com:1433/database_name' + +If serializing with JSON: + +.. code-block:: bash + + export AIRFLOW_CONN_MSSQL_DEFAULT='{ + "conn_type": "mssql", + "login": "username", + "password": "password", + "host": "server.com", + "port": 1433, + "schema": "database_name" + }'