page_type | languages | products | description | urlFragment | |||
---|---|---|---|---|---|---|---|
sample |
|
|
How to use the Azure Cosmos DB with the SQL API with a Flask WebApp |
azure-cosmos-db-sql-python-flask-webapp |
This sample shows a Python web application (Flask) using Azure Cosmos DB SQL API and the Azure Cosmos DB Python SDK.
Before you can run this sample, you must have the following prerequisites:
- Azure Cosmos DB SQL API Account
- Azure Cosmos DB Python SDK
- Python 3.8+ installed
-
Clone this repository using:
git clone https://github.com/Azure-Samples/azure-cosmos-db-python-getting-started.git
-
Open the
config.py
file and replace the ENDPOINT and the KEY values with the values of your Cosmos DB Account. -
Open a command line and run:
python app_todo.py
. -
If a browser doesn't open automatically, start the browser of your choice and navigate to localhost:5000. Alternatively, open a new command line and make requests. See bellow some examples.
TO DO
Follow the steps described in this quickstart to deploy the web application to Azure App Service.