page_type | name | description | urlFragment | languages | products | |||
---|---|---|---|---|---|---|---|---|
sample |
Quickstart: Azure Cosmos DB for NoSQL and Azure SDK for .NET |
This is a simple ASP.NET web application to illustrate common basic usage of Azure Cosmos DB for NoSQL and the Azure SDK for .NET. |
template |
|
|
This is a simple Blazor web application to illustrate common basic usage of Azure Cosmos DB for NoSQL's client library for .NET. This sample application accesses an existing account, database, and container using the Microsoft.Azure.Cosmos
and Azure.Identity
libraries from NuGet.
-
Log in to Azure Developer CLI.
azd auth login
[!TIP] This is only required once per-install.
-
Initialize this template (
cosmos-db-nosql-dotnet-quickstart
) usingazd init
azd init --template cosmos-db-nosql-dotnet-quickstart
-
Ensure that Docker is running in your environment.
-
Use
azd up
to provision your Azure infrastructure and deploy the web application to Azure.azd up
-
Observed the deployed web application
-
(Optionally) Run this web application locally in the
src/web
folder:dotnet watch run
[!IMPORTANT] When your Azure infrastructure is provisioned, the endpoint for your deployed Azure Cosmos DB for NoSQL account is automatically saved in the .NET user secrets store to make debugging easier. For more information, see safe storage of app secrets in development.