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
+65-1Lines changed: 65 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,59 @@ azd auth login
19
19
azd up
20
20
```
21
21
22
+
> [!TIP]
23
+
> Set a custom admin password before provisioning: `azd env set DOCUMENTDB_ADMIN_PASSWORD '<your-secure-password>'`. If not set, a temporary default is used.
24
+
22
25
This command will:
23
26
- Prompt you to create a new Azure environment
24
27
- Provision all infrastructure resources in your Azure subscription
25
-
- Generate a `.env` file in the root directory with all necessary connection strings and credentials
26
28
29
+
After provisioning, export all environment variables to a `.env` file:
30
+
31
+
```bash
32
+
azd env get-values > .env
33
+
```
34
+
35
+
#### Configure OpenAI Settings (Optional)
36
+
37
+
Before running `azd up`, you can customize the OpenAI deployment by setting environment variables. If not set, defaults are used.
38
+
39
+
```bash
40
+
# Set OpenAI location (can differ from resource group location)
41
+
azd env set AZURE_OPENAI_LOCATION eastus2
42
+
43
+
# Chat model configuration
44
+
azd env set AZURE_OPENAI_CHAT_MODEL gpt-4.1-mini
45
+
azd env set AZURE_OPENAI_CHAT_MODEL_VERSION 2025-04-14
46
+
azd env set AZURE_OPENAI_CHAT_MODEL_TYPE Standard
47
+
48
+
# Synthesis model configuration
49
+
azd env set AZURE_OPENAI_SYNTH_MODEL gpt-4.1
50
+
azd env set AZURE_OPENAI_SYNTH_MODEL_VERSION 2025-04-14
51
+
azd env set AZURE_OPENAI_SYNTH_MODEL_TYPE Standard
52
+
53
+
# Embedding model configuration
54
+
azd env set AZURE_OPENAI_EMBEDDING_MODEL text-embedding-3-small
55
+
azd env set AZURE_OPENAI_EMBEDDING_MODEL_VERSION 1
56
+
azd env set AZURE_OPENAI_EMBEDDING_MODEL_TYPE Standard
57
+
```
58
+
59
+
| Variable | Default | Description |
60
+
|----------|---------|-------------|
61
+
|`AZURE_OPENAI_LOCATION`| Same as `AZURE_LOCATION`| Region for OpenAI resources |
62
+
|`AZURE_OPENAI_CHAT_MODEL`|`gpt-4.1-mini`| Chat completion model |
63
+
|`AZURE_OPENAI_CHAT_MODEL_VERSION`|`2025-04-14`| Chat model version |
64
+
|`AZURE_OPENAI_CHAT_MODEL_TYPE`|`Standard`| Deployment SKU (`Standard` or `GlobalStandard`) |
65
+
|`AZURE_OPENAI_SYNTH_MODEL`|`gpt-4.1`| Data synthesis model |
66
+
|`AZURE_OPENAI_SYNTH_MODEL_VERSION`|`2025-04-14`| Synthesis model version |
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
27
75
### 2. Navigate to Your Sample Language
28
76
29
77
Choose your preferred programming language and navigate to the sample directory:
@@ -63,6 +111,22 @@ Follow the language-specific instructions:
63
111
64
112
Each sample demonstrates how to generate embeddings, create vector indexes, and perform semantic similarity searches with hotel data.
65
113
114
+
## Troubleshooting
115
+
116
+
### Azure OpenAI provisioning fails
117
+
118
+
If `azd up` fails when creating the Azure OpenAI resource or model deployments, the issue is typically one of:
119
+
120
+
-**Region availability**: The selected model isn't available in your chosen region. Try a different `AZURE_OPENAI_LOCATION` (e.g., `eastus2`, `swedencentral`).
121
+
-**SKU/tier mismatch**: The model doesn't support the selected deployment type. Switch between `Standard` and `GlobalStandard` using `azd env set AZURE_OPENAI_CHAT_MODEL_TYPE GlobalStandard`.
122
+
-**Quota limits**: Your subscription has reached its quota for the selected model/region/tier combination. Check your quota in the Azure portal under **Azure OpenAI → Quotas**. You can request a quota increase or try a different region with available capacity.
123
+
-**Model retired or unavailable**: Azure OpenAI periodically retires older model versions. If deployment fails because a model version is no longer available, update to a supported version (e.g., `azd env set AZURE_OPENAI_CHAT_MODEL_VERSION <new-version>`). See [Azure OpenAI model retirements](https://learn.microsoft.com/azure/ai-services/openai/concepts/model-retirements) for lifecycle status.
124
+
125
+
All OpenAI model parameters — region, model name, version, and deployment type (Standard/GlobalStandard) — are configurable via `azd env set` before running `azd up`. See [Configure OpenAI Settings](#configure-openai-settings-optional) above for the full list.
126
+
127
+
> [!TIP]
128
+
> Run `azd env set AZURE_OPENAI_LOCATION <region>` to deploy OpenAI to a different region than your other resources. Check [model availability by region](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability) to find supported region/model/tier combinations.
Copy file name to clipboardExpand all lines: ai/vector-search-agent-typescript/README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,9 @@ By the end, you have a working two-agent system that connects Azure OpenAI and A
29
29
> [!NOTE]
30
30
> **Cost considerations:** This quickstart creates Azure OpenAI and Azure DocumentDB resources that incur costs. See [Azure OpenAI pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) and [Azure DocumentDB pricing](https://azure.microsoft.com/pricing/details/cosmos-db/) for details.
31
31
32
+
33
+
> [!NOTE]
34
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
32
35
## Prerequisites
33
36
34
37
You can use the Azure Developer CLI to create the required Azure resources by running the `azd` commands in the sample repository. For more information, see [Deploy Infrastructure with Azure Developer CLI](https://github.com/Azure-Samples/documentdb-samples/).
@@ -98,10 +101,14 @@ Use the Azure Developer CLI (`azd`) to provision the required Azure OpenAI and D
98
101
99
102
1. When prompted, selectyour subscription and a location (for example, `swedencentral` or `eastus2`).
100
103
101
-
1. After deployment completes, `azd` outputs the environment variables you need. Copy them into your `.env` file (see [Configure environment variables](#configure-environment-variables)).
104
+
1. After deployment completes, generate your `.env` file from the deployed environment:
105
+
106
+
```bash
107
+
azd env get-values > .env
108
+
```
102
109
103
110
> [!TIP]
104
-
> Run `azd env get-values` at any time to view the current environment values.
111
+
> Run `azd env get-values> .env` at any time to regenerate the`.env` file with current environment values.
Copy file name to clipboardExpand all lines: ai/vector-search-dotnet/README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,9 @@ This .NET 8.0 sample application demonstrates vector similarity searches using A
21
21
- Seamless integration with DocumentDB and Azure OpenAI services
22
22
- Interactive menu-driven application
23
23
24
+
25
+
> [!NOTE]
26
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
24
27
## Prerequisites
25
28
26
29
### Azure Services
@@ -50,7 +53,17 @@ cd ai/vector-search-dotnet
50
53
az login
51
54
```
52
55
53
-
3. Update `appsettings.json` with your Azure service details:
56
+
3. Configure environment variables:
57
+
58
+
The .NET sample reads configuration from `appsettings.json` and environment variables. After deploying with `azd up`, you can view your provisioned resource values:
59
+
60
+
```bash
61
+
azd env get-values
62
+
```
63
+
64
+
Use these values to update `appsettings.json` or set them as environment variables.
65
+
66
+
4. Update `appsettings.json` with your Azure service details:
Copy file name to clipboardExpand all lines: ai/vector-search-go/README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ products:
14
14
15
15
This project demonstrates vector search capabilities using Azure DocumentDB with Go. It includes implementations of three different vector index types: DiskANN, HNSW, and IVF, along with utilities for embedding generation and data management.
16
16
17
+
18
+
> [!NOTE]
19
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
17
20
## Overview
18
21
19
22
Vector search enables semantic similarity searching by converting text into high-dimensional vector representations (embeddings) and finding the most similar vectors in the database. This project shows how to:
@@ -116,6 +119,16 @@ az resource show \
116
119
117
120
### Step 4: Configure Environment Variables
118
121
122
+
If you deployed Azure resources with `azd up` (from the repository root), create a `.env` file with your provisioned resource values:
123
+
124
+
```bash
125
+
azd env get-values > .env
126
+
```
127
+
128
+
This creates a `.env` file with the connection strings and endpoints needed to run the sample.
129
+
130
+
Alternatively, you can configure the environment manually:
Copy file name to clipboardExpand all lines: ai/vector-search-java/README.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ products:
14
14
15
15
This project demonstrates vector search capabilities using Azure DocumentDB with Java. It includes implementations of three different vector index types: DiskANN, HNSW, and IVF.
16
16
17
+
18
+
> [!NOTE]
19
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
17
20
## Overview
18
21
19
22
Vector search enables semantic similarity searching by converting text into high-dimensional vector representations (embeddings) and finding the most similar vectors in the database. This project shows how to:
@@ -92,7 +95,16 @@ The `azd up` command will:
92
95
- Deploy Azure DocumentDB (MongoDB vCore) cluster
93
96
- Create a managed identity for secure access
94
97
- Configure all necessary permissions and networking
95
-
- Generate a `.env` file with all connection information at the repository root
98
+
99
+
### Configure environment variables
100
+
101
+
After deploying with `azd up`, create a `.env` file with your provisioned resource values:
102
+
103
+
```bash
104
+
azd env get-values > .env
105
+
```
106
+
107
+
This creates a `.env` file at the repository root with the connection strings and endpoints needed to run the sample.
96
108
97
109
### Compile the Project
98
110
@@ -106,7 +118,7 @@ mvn clean compile
106
118
107
119
### Load Environment Variables
108
120
109
-
After deployment completes, load the environment variables from the generated`.env` file. The `set -a` command ensures variables are exported to child processes (like the Maven JVM):
121
+
Load the environment variables from the `.env` file. The `set -a` command ensures variables are exported to child processes (like the Maven JVM):
Copy file name to clipboardExpand all lines: ai/vector-search-python/README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ products:
14
14
15
15
This project demonstrates vector search capabilities using Azure DocumentDB with Python. It includes implementations of three different vector index types: DiskANN, HNSW, and IVF, along with utilities for embedding generation and data management.
16
16
17
+
18
+
> [!NOTE]
19
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
17
20
## Overview
18
21
19
22
Vector search enables semantic similarity searching by converting text into high-dimensional vector representations (embeddings) and finding the most similar vectors in the database. This project shows how to:
@@ -93,6 +96,16 @@ Learn how to create an Azure DocumentDB account in the [official documentation](
93
96
94
97
### Step 3: Configure Environment Variables
95
98
99
+
If you deployed Azure resources with `azd up` (from the repository root), create a `.env` file with your provisioned resource values:
100
+
101
+
```bash
102
+
azd env get-values > .env
103
+
```
104
+
105
+
This creates a `.env` file with the connection strings and endpoints needed to run the sample.
106
+
107
+
Alternatively, you can configure the environment manually:
Copy file name to clipboardExpand all lines: ai/vector-search-typescript/README.md
+12-15Lines changed: 12 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ products:
14
14
15
15
This project demonstrates vector search capabilities using Azure DocumentDB with TypeScript/Node.js. It includes implementations of three different vector index types: DiskANN, HNSW, and IVF, along with utilities for embedding generation and data management.
16
16
17
+
18
+
> [!NOTE]
19
+
> **Vector indexes can be created or dropped on existing collections at any time** — no special configuration is needed at resource creation.
17
20
## Overview
18
21
19
22
Vector search enables semantic similarity searching by converting text into high-dimensional vector representations (embeddings) and finding the most similar vectors in the database. This project shows how to:
@@ -92,8 +95,16 @@ The `azd provision` command will:
92
95
- Deploy Azure DocumentDB (MongoDB vCore) cluster
93
96
- Create a managed identity for secure access
94
97
- Configure all necessary permissions and networking
95
-
- Generate a `.env` file with all connection information at the root
96
98
99
+
### Configure environment variables
100
+
101
+
After deploying with `azd up`, create a `.env` file with your provisioned resource values:
102
+
103
+
```bash
104
+
azd env get-values > .env
105
+
```
106
+
107
+
This creates a `.env` file at the repository root with the connection strings and endpoints needed to run the sample.
97
108
98
109
### Install dependencies
99
110
@@ -105,20 +116,6 @@ cd ai/vector-search-typescript
105
116
npm install
106
117
```
107
118
108
-
### Verify Environment Configuration
109
-
110
-
After deployment completes, verify that the `.env` file was created in the repository root:
111
-
112
-
```bash
113
-
# View the generated environment variables
114
-
cat ../../.env
115
-
```
116
-
117
-
The file should contain all necessary configuration including:
0 commit comments