This is an automated email from the ASF dual-hosted git repository. jscheffl pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new 9f4f8b3553 Add environment var example to mssql.rst (#37418) 9f4f8b3553 is described below commit 9f4f8b3553ea02e021712b893d9d076f9c9b5e11 Author: Dikarabo-Molele <dikarabo-mol...@users.noreply.github.com> AuthorDate: Fri Feb 16 01:11:41 2024 +0200 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+jsche...@users.noreply.github.com> * Update docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst Remove unnecessary .. Co-authored-by: Wei Lee <weilee...@gmail.com> --------- Co-authored-by: Jens Scheffler <95105677+jsche...@users.noreply.github.com> Co-authored-by: Wei Lee <weilee...@gmail.com> --- .../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 9e66429044..a2990742ae 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 <https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15>`_. + +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:passw...@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" + }'