Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lgmorand/todo-cosmosdb-demo-app
Demo of a containerized todo-list application, coded in .Net Core and using CosmosDB as backend
https://github.com/lgmorand/todo-cosmosdb-demo-app
Last synced: 6 days ago
JSON representation
Demo of a containerized todo-list application, coded in .Net Core and using CosmosDB as backend
- Host: GitHub
- URL: https://github.com/lgmorand/todo-cosmosdb-demo-app
- Owner: lgmorand
- License: mit
- Created: 2020-05-09T08:53:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-25T10:51:34.000Z (over 3 years ago)
- Last Synced: 2024-05-02T05:06:35.525Z (7 months ago)
- Language: HTML
- Size: 509 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Web application development with ASP.NET Core MVC using Azure Cosmos DB
This sample shows you how to use the Microsoft Azure Cosmos DB service to store and access data from an ASP.NET Core MVC application hosted on Azure App Service
## Configuration
The application requires a connection string and a secret:
- **DB_URL**: URL of the cosmosDB endpoint
- **DB_SECRET**: key to connect to the databaseApplication can also read from ENV variables: (__is a double underscore for containers. standard applications can use ":" instead)
- **COSMOSDB__DB_URL**: URL of the cosmosDB endpoint
- **COSMOSDB__DB_SECRET**: key to connect to the database## Running this sample in Visual Studio
1. Before you can run this sample, you must have the following perquisites:
- Visual Studio 2017 (or higher).
- An active Azure Cosmos account or the [Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator) - If you don't have an account, refer to the [Create a database account](https://docs.microsoft.com/en-us/azure/cosmos-db/create-sql-api-dotnet#create-an-azure-cosmos-db-account) article2.Clone this repository using Git for Windows (http://www.git-scm.com/), or download the zip file.
3.From Visual Studio, open the [CosmosWebSample.csproj](./src/CosmosWebSample.csproj).
4.In Visual Studio Build menu, select **Build Solution** (or Press F6).
5.Retrieve the URI and PRIMARY KEY (or SECONDARY KEY) values from the Keys blade of your Azure Cosmos account in the Azure portal. For more information on obtaining endpoint & keys for your Azure Cosmos account refer to [View, copy, and regenerate access keys and passwords](https://docs.microsoft.com/azure/cosmos-db/secure-access-to-data#master-keys) **if you are going to work with a real Azure Cosmos account**.
* The default configuration is setup to work with a local Azure Cosmos DB Emulator.6.In the [appSettings.json](./src/appSettings.json) file, located in the project root, find **Account** and **Key** and replace the placeholder values with the values obtained for your account if you are going to work with a real Azure Cosmos account.
7.You can now run and debug the application locally by pressing **F5** in Visual Studio.
## Infrastructure as code
The folder **/deploy** contains the ARM template to provision a cosmosDB
## Kubernetes deployment
The folder **/manifest** contains the YAML manifest to deploy the application. Container image endpoint must be modified with your own value
## More information
- [Azure Cosmos DB Documentation](https://docs.microsoft.com/azure/cosmos-db)
- [Azure Cosmos DB .NET SDK](https://docs.microsoft.com/azure/cosmos-db/sql-api-sdk-dotnet)
- [Azure Cosmos DB .NET SDK Reference Documentation](https://docs.microsoft.com/dotnet/api/overview/azure/cosmosdb?view=azure-dotnet)