Skip to content

Commit 728babf

Browse files
committed
Add quickstart include files
1 parent e25b37d commit 728babf

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
author: seesharprun
3+
ms.author: sidandrews
4+
ms.service: cosmos-db
5+
ms.subservice: apache-gremlin
6+
ms.topic: include
7+
ms.date: 09/27/2023
8+
---
9+
10+
1. Create shell variables for *accountName*, *resourceGroupName*, and *location*.
11+
12+
```azurecli-interactive
13+
# Variable for resource group name
14+
resourceGroupName="msdocs-cosmos-gremlin-quickstart"
15+
location="westus"
16+
17+
# Variable for account name with a randomly generated suffix
18+
19+
let suffix=$RANDOM*$RANDOM
20+
accountName="msdocs-gremlin-$suffix"
21+
```
22+
23+
1. If you haven't already, sign in to the Azure CLI using `az login`.
24+
25+
1. Use `az group create` to create a new resource group in your subscription.
26+
27+
```azurecli-interactive
28+
az group create \
29+
--name $resourceGroupName \
30+
--location $location
31+
```
32+
33+
1. Use `az cosmosdb create` to create a new API for NoSQL account with default settings.
34+
35+
```azurecli-interactive
36+
az cosmosdb create \
37+
--resource-group $resourceGroupName \
38+
--name $accountName \
39+
--capabilities "EnableGremlin" \
40+
--locations regionName=$location \
41+
--enable-free-tier true
42+
```
43+
44+
> [!NOTE]
45+
> You can have up to one free tier Azure Cosmos DB account per Azure subscription and must opt-in when creating the account. If this command fails to apply the free tier discount, this means another account in the subscription has already been enabled with free tier.
46+
47+
1. Get the API for Gremlin endpoint *NAME* for the account using `az cosmosdb show`.
48+
49+
```azurecli-interactive
50+
az cosmosdb show \
51+
--resource-group $resourceGroupName \
52+
--name $accountName \
53+
--query "name"
54+
```
55+
56+
1. Find the *KEY* from the list of keys for the account with `az-cosmosdb-keys-list`.
57+
58+
```azurecli-interactive
59+
az cosmosdb keys list \
60+
--resource-group $resourceGroupName \
61+
--name $accountName \
62+
--type "keys" \
63+
--query "primaryMasterKey"
64+
```
65+
66+
1. Record the *NAME* and *KEY* values. You use these credentials later.
67+
68+
1. Create a *database* named `cosmicworks` using `az cosmosdb gremlin database create`.
69+
70+
```azurecli-interactive
71+
az cosmosdb gremlin database create \
72+
--resource-group $resourceGroupName \
73+
--account-name $accountName \
74+
--name "cosmicworks"
75+
```
76+
77+
1. Create a *graph* using `az cosmosdb gremlin graph create`. Name the graph `products`, then set the throughput to `400`, and finally set the partition key path to `/category`.
78+
79+
```azurecli-interactive
80+
az cosmosdb gremlin graph create \
81+
--resource-group $resourceGroupName \
82+
--account-name $accountName \
83+
--database-name "cosmicworks" \
84+
--name "products" \
85+
--partition-key-path "/category" \
86+
--throughput 400
87+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
author: seesharprun
3+
ms.author: sidandrews
4+
ms.service: cosmos-db
5+
ms.subservice: apache-gremlin
6+
ms.topic: include
7+
ms.date: 09/27/2023
8+
---
9+
10+
> [!div class="op_single_selector"]
11+
>
12+
> - [Gremlin console](../quickstart-console.md)
13+
> - [.NET](../quickstart-dotnet.md)
14+
> - [Node.js](../quickstart-nodejs.md)
15+
> - [Python](../quickstart-python.md)
16+
>

0 commit comments

Comments
 (0)