Skip to content

Commit

Permalink
Add environment var example to mssql.rst (apache#37418)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update docs/apache-airflow-providers-microsoft-mssql/connections/mssql.rst

Remove unnecessary ..

Co-authored-by: Wei Lee <[email protected]>

---------

Co-authored-by: Jens Scheffler <[email protected]>
Co-authored-by: Wei Lee <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent 42f8d04 commit 9f4f8b3
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]: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"
}'

0 comments on commit 9f4f8b3

Please sign in to comment.