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
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,14 @@ Design patterns play a crucial role in building robust applications and modeling
11
11
### Key Benefits of Using Design Patterns
12
12
13
13
-**Efficiency and Best Practices**: Design patterns encapsulate proven solutions, saving you time and effort by leveraging established best practices.
14
-
15
14
-**Scalability and Performance**: Many patterns are optimized for scalability, ensuring your application can handle growth without compromising performance.
16
-
17
15
-**Consistency and Maintainability**: Patterns promote consistent architecture, making codebases easier to understand, maintain, and extend.
18
-
19
16
-**Reliability and Resilience**: Patterns address fault tolerance and error handling, resulting in applications that gracefully recover from failures.
20
-
21
17
-**Flexibility and Adaptability**: Patterns facilitate changes, enabling your application to evolve and adapt to new requirements seamlessly.
22
-
23
18
-**Reusability and Accelerated Development**: Patterns encourage reusable components, speeding up development and reducing the risk of bugs.
24
-
25
19
-**Effective Data Modeling**: In NoSQL databases like Azure Cosmos DB, choosing the right pattern ensures efficient data modeling for enhanced performance.
26
-
27
20
-**Documentation and Communication**: Patterns provide a shared vocabulary, aiding communication and collaboration among team members.
28
-
29
21
-**Adherence to Best Practices**: Design patterns ensure applications adhere to security, data integrity, and maintainability best practices.
30
-
31
22
-**Reduced Learning Curve**: Developers familiar with patterns quickly understand and contribute to projects, reducing onboarding time.
32
23
33
24
@@ -74,15 +65,31 @@ Dive into the `schema-versioning` folder to learn how to manage changes to your
74
65
75
66
## Getting Started
76
67
77
-
Navigate to the individual folders of each design pattern for a dedicated `README.md` file that provides step-by-step instructions on how to implement and work with the pattern in your applications.
68
+
### Using the Terminal:
69
+
- Open the terminal on your computer.
70
+
- Navigate to the directory where you want to clone the repository.
71
+
- Type `git clone https://github.com/Azure-Samples/cosmos-db-design-patterns.git` and press enter.
72
+
- The repository will be cloned to your local machine.
73
+
74
+
### Using Visual Studio Code:
75
+
- Open Visual Studio Code.
76
+
- Click on the **Source Control** icon in the left sidebar.
77
+
- Click on the **Clone Repository** button at the top of the Source Control panel.
78
+
- Paste `https://github.com/Azure-Samples/cosmos-db-design-patterns.git` into the text field and press enter.
79
+
- Select a directory where you want to clone the repository.
80
+
- The repository will be cloned to your local machine.
81
+
82
+
### Using GitHub Codespaces
83
+
84
+
Nearly all of these samples are configured to run from [GitHub Codespaces](https://docs.github.com/codespaces/overview).
78
85
79
-
### Trying Out the Design Patterns with Azure Cosmos DB for Free
86
+
Navigate to the individual folders of each design pattern for a dedicated `README.md` file and look for the GitHub Codespaced badge.
80
87
81
-
You can try out these design patterns using a **free Azure Cosmos DB account**, making it easy to experiment with Azure Cosmos DB before making a commitment. No credit card is required to get started, and your account is free for 30 days. After the initial 30-day period, you can create a new sandbox account. Additionally, you have the option to extend the trial beyond 30 days for an additional 24 hours. If you decide to upgrade, you can do so at any time during the 30-day trial period.
88
+
### Setting up Azure Cosmos DB
82
89
83
-
**Sign up for your free Azure Cosmos DB account at [aka.ms/trycosmosdb](https://aka.ms/trycosmosdb).**
90
+
All of these design patterns are built to run from a single Serverless Azure Cosmos DB account. Before running any of the samples, click the Deploy to Azure button below to create a Serverless Azure Cosmos DB account. You will need the URI Primary Key and Connection String for these. Keep those handy as you prepare each sample to run.
84
91
85
-
This opportunity provides a risk-free environment to explore these design patterns and see how Azure Cosmos DB can enhance your application development and data modeling efforts. Whether you're an experienced developer or just getting started, the free trial allows you to discover the benefits firsthand.
92
+
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fgithub.com%2FAzureCosmosDB%2Fdesign-patterns%2Ftree%2Fmain%2Fazuredeploy.json)
86
93
87
94
Happy coding with Azure Cosmos DB and these powerful design patterns!
Copy file name to clipboardExpand all lines: attribute-array/README.md
+21-26Lines changed: 21 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,38 +176,19 @@ You can try out this implementation by running the code in [GitHub Codespaces](h
176
176
177
177
[](https://codespaces.new/azure-samples/cosmos-db-design-patterns?quickstart=1&devcontainer_path=.devcontainer%2Fattribute-array%2Fdevcontainer.json)
178
178
179
-
## Create an Azure Cosmos DB for NoSQL account
179
+
## Set up application configuration files
180
180
181
-
1. Create a free Azure Cosmos DB for NoSQL account: (<https://cosmos.azure.com/try>)
181
+
You need to configure **two** application configuration files to run these demos.
182
182
183
-
1.In the Data Explorer, create a new database named **CosmosPatterns** with shared autoscale throughput:
183
+
1.Go to your resource group.
184
184
185
-
|| Value |
186
-
| --- | --- |
187
-
|**Database name**|`CosmosPatterns`|
188
-
|**Throughput**|`1000` (*Autoscale*) |
185
+
1. Select the Serverless Azure Cosmos DB for NoSQL account that you created for this repository.
189
186
190
-
**Note:** We are using shared database throughput because it can scale down to 100 RU/s when not running. This is the most cost efficient if running in a paid subscription and not using Free Tier.
187
+
1. From the navigation, under **Settings**, select **Keys**. The values you need for the application settings for the demo are here.
191
188
192
-
1. Create a container **AttributeArrays** with the following values:
189
+
While on the Keys blade, make note of the `URI` and `PRIMARY KEY`. You will need these for the sections below.
193
190
194
-
|| Value |
195
-
| --- | --- |
196
-
|**Database name**|`CosmosPatterns`|
197
-
|**Container name**|`AttributeArrays`|
198
-
|**Partition key path**|`/productId`|
199
-
200
-
## Get Azure Cosmos DB connection information
201
-
202
-
You will need connection details for the Azure Cosmos DB account.
203
-
204
-
1. Select the new Azure Cosmos DB for NoSQL account.
205
-
206
-
1. Open the Keys blade, click the Eye icon to view the `PRIMARY KEY`. Keep this and the `URI` handy. You will need these for the next step.
207
-
208
-
## Prepare the app configuration
209
-
210
-
1. Open the application code, create an **appsettings.Development.json** file in the **/source** folder. In the file, create a JSON object with **CosmosUri** and **CosmosKey** properties. Copy and paste the values for `URI` and `PRIMARY KEY` from the previous step:
191
+
1. Open the attribute-array project and add a new **appsettings.development.json** file with the following contents:
211
192
212
193
```json
213
194
{
@@ -216,6 +197,20 @@ You will need connection details for the Azure Cosmos DB account.
216
197
}
217
198
```
218
199
200
+
1. Replace the `CosmosURI` and `CosmosKey` with the values from the Keys blade in the Azure Portal.
201
+
1. Modify the **Copy to Output Directory** to **Copy Always** (For VS Code add the XML below to the csproj file)
0 commit comments