You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+25-62Lines changed: 25 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,85 +12,48 @@ products:
12
12
13
13
# Quickstart: Azure Cosmos DB for NoSQL client library for .NET
14
14
15
-
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`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos) and [`Azure.Identity`](https://www.nuget.org/packages/Azure.Identity) libraries from NuGet. Modify the source code and leverage the Infrastructure as Code (IaC) Bicep assets to get up and running quickly.
16
-
17
-
When you are finished, you will have a fully functional web application deployed to Azure.
18
-
19
-

20
-
21
-
<sup>Screenshot of the deployed web application.</sup>
15
+
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`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos) and [`Azure.Identity`](https://www.nuget.org/packages/Azure.Identity) libraries from NuGet.
22
16
23
17
### Prerequisites
24
18
25
-
> This template will create infrastructure and deploy code to Azure. If you don't have an Azure Subscription, you can sign up for a [free account here](https://azure.microsoft.com/free/). Make sure you have the contributor role in the Azure subscription.
26
-
27
-
The following prerequisites are required to use this application. Please ensure that you have them all installed locally.
To learn how to get started with any template, follow the steps in [this quickstart](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-dotnet) with this template (`cosmos-db-nosql-dotnet-quickstart`).
35
-
36
-
This quickstart will show you how to authenticate on Azure, initialize using a template, provision infrastructure and deploy code on Azure via the following commands:
37
-
38
-
```bash
39
-
# Log in to azd. Only required once per-install.
40
-
azd auth login
41
-
42
-
# First-time project setup. Initialize a project in the current directory, using this template.
43
-
# Omit the --template argument if you are running in a development container.
- This service hosts the ASP.NET Blazor web application.
58
-
-[**Azure Cosmos DB for NoSQL**](https://learn.microsoft.com/azure/cosmos-db/)
59
-
- This service stores the NoSQL data.
27
+
```bash
28
+
azd auth login
29
+
```
60
30
61
-
Here's a high level architecture diagram that illustrates these components. Notice that these are all contained within a single **resource group**, that will be created for you when you create the resources.
This template provisions resources to an Azure subscription that you will select upon provisioning them. Refer to the [Pricing calculator for Microsoft Azure](https://azure.microsoft.com/pricing/calculator/) to estimate the cost you might incur when this template is running on Azure and, if needed, update the included Azure resource definitions found in [`infra/main.bicep`](infra/main.bicep) to suit your needs.
40
+
1. Ensure that **Docker**is running in your environment.
83
41
84
-
### Application Code
42
+
1. Use `azd up` to provision your Azure infrastructure and deploy the web application to Azure.
85
43
86
-
This template is structured to follow the [Azure Developer CLI](https://aka.ms/azure-dev/overview). You can learn more about `azd` architecture in [the official documentation](https://learn.microsoft.com/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-create#understand-the-azd-architecture).
44
+
```bash
45
+
azd up
46
+
```
87
47
88
-
### Next Steps
48
+
1. Observed the deployed web application
89
49
90
-
At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.
50
+

91
51
92
-
-[`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.
52
+
1. (Optionally) Run this web application locally inthe `src/web` folder:
93
53
94
-
-[Run and Debug Locally](https://learn.microsoft.com/azure/developer/azure-developer-cli/debug?pivots=ide-vs-code) - using Visual Studio Code and the Azure Developer CLI extension
54
+
```dotnetcli
55
+
dotnet watch run
56
+
```
95
57
96
-
-[`azd down`](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference#azd-down) - to delete all the Azure resources created with this template
58
+
> [!IMPORTANT]
59
+
> When your Azure infrastructure is provisioned, the endpoint foryour deployed Azure Cosmos DB for NoSQL account is automatically savedin the .NET user secrets store to make debugging easier. For more information, see [safe storage of app secrets in development](https://learn.microsoft.com/aspnet/core/security/app-secrets).
0 commit comments