Skip to content

Commit 44502b3

Browse files
committed
updated readme
1 parent 96f95b9 commit 44502b3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ Check out more samples to test all implemented verbs here:
125125

126126
[cUrl Samples](./sample-usage.md)
127127

128+
## Debug from Visual Studio Code
129+
130+
Debugging from Visual Studio Code is fully supported. Make sure you create an `.env` file the look like the following one (making sure you add your connection string)
131+
132+
```
133+
FLASK_ENV="development"
134+
SQLAZURECONNSTR_WWIF=""
135+
```
136+
137+
and you'll be good to go.
138+
128139
## Deploy to Azure
129140

130141
Now that your REST API solution is ready, it's time to deploy it on Azure so that anyone can take advantage of it. A detailed article on how you can that that is here:
@@ -153,6 +164,12 @@ https://docs.microsoft.com/en-us/azure/app-service/configure-common#connection-s
153164

154165
That's why the Python code in the sample look for `SQLAZURECONNSTR_WWIF` but the Shell script write the `WWIF` connection string name.
155166

167+
## Connection Resiliency
168+
169+
As per best practices, code implement a retry logic to make sure connections to Azure SQL are resilient and che nicely handle those cases in which the database may not be available. One of these case is when database is being scale up or down. This is usually a pretty fast operation (with Azure SQL Hyperscale it happens in something around 10 seconds), but still graceful management of connection is needed.
170+
171+
The sample uses the [Tenacity](https://tenacity.readthedocs.io/en/latest/) library to implement a simple retry-logic in case the error "Communication link failure" happens (see [ODBC Error Codes](https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/appendix-a-odbc-error-codes))
172+
156173
## Learn more
157174

158175
If you're new to Python and want to learn more, there is a full free Python curse here:

0 commit comments

Comments
 (0)