Sample ASP.NET web application to use with API for NoSQL. This sample is used in the API for NOSQL web application tutorial. This sample is built using .NET 6 (LTS).
This project framework provides the following features:
- ASP.NET Razor Pages
- Dependency injection of a singleton CosmosClient (per best practices).
- CDN-based Bootstrap 5.2, Bootstrap Icons 1.9, and Masonry 4.2.
- Sample data from azurecosmosdb/cosmicworks. on GitHub
(ideally very short, if any)
- .NET 6 or later
- Shell (Bash/PowerShell)
-
Install the CosmicWorks.Template.Web package from NuGet:
dotnet install CosmicWorks.Template.Web
-
In an empty directory, create a new ASP.NET web application project using the project template:
dotnet new cosmosdbnosql-webapp
๐ Note: The name of the project will be the same as the empty folder's name. To influence this, use the
--name
and-output
options.
-
Build the project:
dotnet build
-
Optionally, open the project in Visual Studio Code.
code .
-
Run the project leaving the option to refresh on code changes:
dotnet watch
๐ Note: Under normal circumstances, the web application should be hosted at port 5000 and the URL
http://localhost:5000
. -
Open a web browser and navigate to the running web application.
- Want to update this template to use Azure Cosmos DB for NoSQL? See the corresponding tutorial.
- Want to learn more about NoSQL in Azure Cosmos DB? Check out our documentation.