Skip to content

Commit 3bc2999

Browse files
committed
docs: Move Azure note to its own document.
Also, highlight note about the fact the required format of the username field is a shorter one, update examples.
1 parent b3f590a commit 3bc2999

4 files changed

Lines changed: 35 additions & 29 deletions

File tree

docs/azure.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
================================
2+
Connecting to Azure SQL Database
3+
================================
4+
5+
Starting with version 2.1.1 pymssql can be used to connect to *Microsoft Azure
6+
SQL Database*.
7+
8+
Make sure the following requirements are met:
9+
10+
* Use FreeTDS 0.91 or newer
11+
* Use TDS protocol 7.1 or newer
12+
* Make sure FreeTDS is built with SSL support
13+
* Specify the database name you are connecting to in the *database* parameter of
14+
the relevant ``connect()`` call
15+
* **IMPORTANT**: Do not use ``username@server.database.windows.net`` for the
16+
*user* parameter of the relevant ``connect()`` call! You must use the shorter
17+
``username@server`` form instead!
18+
19+
Example::
20+
21+
pymssql.connect("xxx.database.windows.net", "username@xxx", "password", "db_name")
22+
23+
or, if you've defined ``myalias`` in the ``freetds.conf`` FreeTDS config file::
24+
25+
[myalias]
26+
host = xxx.database.windows.net
27+
tds version = 7.1
28+
...
29+
30+
then you could use::
31+
32+
pymssql.connect("myalias", "username@xxx", "password", "db_name")

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Documentation
8989
faq
9090
building_and_developing
9191
freetds_and_dates
92+
azure
9293
docker
9394
changelog
9495
todo

docs/ref/_mssql.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,7 @@ Functions
113113
the literal shown above.
114114

115115
.. note::
116-
If you need to connect to Azure:
117-
118-
* Use FreeTDS 0.91 or newer (this is already a requirement of pymssql)
119-
* Use TDS 7.1 or newer
120-
* Make sure FreeTDS is built with SSL support
121-
* Specify the database name you are connecting to in the *database* parameter
122-
* Specify the username in *username@servername* form
116+
If you need to connect to Azure read the relevant :doc:`topic </azure>`.
123117

124118
.. versionadded:: 2.1.1
125119
The ability to connect to Azure.

docs/ref/pymssql.rst

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,7 @@ Functions
7373
timeouts have a global effect.
7474

7575
.. note::
76-
If you need to connect to Azure:
77-
78-
* Use FreeTDS 0.91 or newer (this is already a requirement of pymssql)
79-
* Use TDS 7.1 or newer
80-
* Make sure FreeTDS is built with SSL support
81-
* Specify the database name you are connecting to in the ``connect()`` call
82-
* Specify the username in *username@servername* form in the ``connect()`` call
83-
84-
Example::
85-
86-
pymssql.connect("xxx.database.windows.net", "username@xxx.database.windows.net", "password", "db_name")
87-
88-
or::
89-
90-
pymssql.connect("myalias", "username@xxx.database.windows.net", "password", "db_name")
91-
92-
if you've defined ``myalias`` in the ``freetds.conf`` FreeTDS config file::
93-
94-
[myalias]
95-
host = xxx.database.windows.net
96-
tds version = 7.1
97-
...
76+
If you need to connect to Azure read the relevant :doc:`topic </azure>`.
9877

9978
.. versionadded:: 2.1.1
10079
The ability to connect to Azure.

0 commit comments

Comments
 (0)