This repository hosts a Todo List application that demonstrates the integration of Azure Cosmos DB as a backend database with a FastAPI service in Python. It offers a simple interface for users to manage their tasks with Create, Read, Update, and Delete (CRUD) operations.
- Set up the development environment and install the required Python libraries.
- Connect to Azure Cosmos DB using a KEY with the Python client.
- Create the necessary databases and containers using Python.
- Definition of the ToDoItem data model within FastAPI and implementation of the CRUD API endpoints.
- Click on the Open in GitHub Codespaces above to open this repository in Codespaces.
- Within the Codespaces environment, navigate to the /src/ directory and create a .env file. Populate it with your Azure Cosmos DB URI and KEY like so:
COSMOS_URI = "your_cosmos_db_uri"
COSMOS_KEY = "your_cosmos_db_key"
- Launch the web app by running the following commands:
cd src/ &&
uvicorn main:app --reload
For more detailed explanations and insights about this project, check out my blog post: