A simple Cosmos DB API app built in ASP.NET Core for acting as a middle layer between web/mobile applications and a Cosmos DB backend.
- Create your Cosmos DB instance along with a database, collection and document: https://docs.microsoft.com/en-us/azure/cosmos-db/create-cosmosdb-resources-portal
- Pull and open the API app code in VS Code
- Update the Cosmos DB config in the appsettings.json file with your Cosmos DB instance secret, database name and URI
- Hit Debug and use Postman to query your API (which should be running at
localhost:5001
), updating the suffix with the associated action you want to perform, for example/database/GetDocument/<COLLECTION NAME>/<DOCUMENT ID>/<PARTITION KEY>
. You can find all of the actions you can perform in the comments in theDatabaseController.cs
file.
Feel free to add more and contribute to make this repo better :)