Skip to content

Commit 007684b

Browse files
Copilotdiberry
andcommitted
Fix documentation based on PR feedback: update doc count to 263, clarify hooks, add AVM details
Co-authored-by: diberry <[email protected]>
1 parent 604a1f8 commit 007684b

7 files changed

+69
-50
lines changed

docs/01-getting-started.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,16 @@ azd up
5353

5454
### 4. Wait for Document Indexing
5555

56-
After deployment completes, the system will automatically index PDF documents into Azure AI Search. The sample includes **262 documents** that need to be indexed before you can use the `/answer` endpoint effectively.
56+
After deployment completes, the system will automatically index PDF documents into Azure AI Search. The sample includes **263 documents** that need to be indexed before you can use the `/answer` endpoint effectively.
5757

5858
You can check the indexing status in the deployment output, or use the Azure Portal to view your Azure AI Search service.
5959

6060
### 5. Test the API
6161

62-
Once indexing is complete, you can test the API:
62+
Once indexing is complete, you can test the API using the URL displayed at the end of the `azd up` command:
6363

6464
```bash
65-
# Get the deployed app URL from azd
66-
azd env get-values | grep SERVICE_API_URI
67-
68-
# Test the API
65+
# Test the API (use the URL from azd up output)
6966
curl -X POST <YOUR_API_URL>/answer \
7067
-H "Content-Type: application/json" \
7168
-d '{"question": "What are the standard benefit options?"}'
@@ -90,7 +87,7 @@ If deployment fails, check:
9087
### Can't Query Documents
9188

9289
If queries return empty results:
93-
- Ensure all 262 documents are indexed (check `INDEX_DOCUMENT_COUNT` in environment variables)
90+
- Ensure all 263 documents are indexed (check `INDEX_DOCUMENT_COUNT` in environment variables)
9491
- Wait a few minutes after deployment for indexing to complete
9592
- Check the Azure AI Search service in the Azure Portal
9693

docs/02-local-development.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,9 @@ This will install dependencies for both the root project and all workspace packa
6262

6363
### 2. Configure Environment Variables
6464

65-
Create a `.env` file in the repository root:
65+
**Prerequisites**: Complete the `azd up` deployment first (see [Getting Started](./01-getting-started.md)), which automatically creates the `.env` file with all necessary Azure resource information.
6666

67-
```bash
68-
cp sample.env .env
69-
```
70-
71-
Edit `.env` with your Azure resource information:
67+
If you need to manually update environment variables, edit the `.env` file in the repository root:
7268

7369
```bash
7470
# Azure OpenAI
@@ -132,14 +128,16 @@ The API server will start on `http://localhost:3000`.
132128

133129
### Working with Vector Data
134130

131+
**Note**: If you deployed with `azd up`, vector data is already loaded. These commands are only needed if you're setting up from scratch without using `azd up`.
132+
135133
```bash
136-
# Load PDF documents into Azure AI Search index
134+
# Load PDF documents into Azure AI Search index (only needed if not using azd up)
137135
npm run load_data
138136

139-
# Test embedding generation
137+
# Test embedding generation (useful for verifying Azure OpenAI authentication)
140138
npm run embed
141139

142-
# Test LLM completion
140+
# Test LLM completion (useful for verifying Azure OpenAI authentication)
143141
npm run llm
144142
```
145143

docs/03-infrastructure-deployment.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ All configuration is injected as environment variables:
141141
- Azure OpenAI instance names and model names
142142
- API versions for completions and embeddings
143143
- `SET_PASSWORDLESS=true` for managed identity authentication
144-
- `AZURE_CLIENT_ID` for the managed identity
145144

146145
## Deployment Commands
147146

@@ -162,29 +161,29 @@ This runs the complete deployment pipeline:
162161

163162
### Incremental Commands
164163

164+
**Note**: These commands are handled automatically by `azd up` hooks. You typically won't need to run them manually unless you're doing custom development.
165+
165166
```bash
166167
# Provision/update infrastructure only
167168
azd provision
168169
169170
# Deploy application code only (infrastructure must exist)
170171
azd deploy
171172
172-
# View environment variables
173-
azd env get-values
174-
175-
# Set environment variable
176-
azd env set KEY value
177-
178173
# Delete all resources
179-
azd down
174+
azd down --purge
180175
```
181176

177+
**About `--purge` flag**: Using `azd down --purge` immediately releases Azure resource quotas. Without `--purge`, some resources (like OpenAI deployments) may hold quota for up to 48 hours, which could prevent redeployment.
178+
182179
## Bicep Infrastructure as Code
183180

184-
The `infra/main.bicep` file uses Azure Verified Modules (AVM) for best-practice resource configuration:
181+
The `infra/main.bicep` file uses [Azure Verified Modules (AVM)](https://azure.github.io/Azure-Verified-Modules/) for best-practice resource configuration.
182+
183+
**Why use AVM?** Azure Verified Modules provide pre-built, tested, and maintained Bicep modules that follow Microsoft's best practices. Instead of writing raw Bicep resource definitions, you use these curated modules which handle security, networking, and configuration complexity for you. This reduces errors and ensures your infrastructure follows Azure's recommended patterns.
185184

186185
```bicep
187-
// Example: OpenAI deployment
186+
// Example: OpenAI deployment using AVM
188187
module openAi 'br/public:avm/res/cognitive-services/account:0.7.1' = {
189188
params: {
190189
name: openAiServiceName
@@ -203,10 +202,11 @@ module openAi 'br/public:avm/res/cognitive-services/account:0.7.1' = {
203202
}
204203
```
205204

206-
### Benefits of Bicep:
205+
### Benefits of Bicep with AVM:
207206
- **Type safety**: Catch errors at compile time
208207
- **Intellisense**: Editor support for Azure resource properties
209208
- **Modularity**: Reusable modules from Azure Verified Modules
209+
- **Best practices built-in**: Security, networking, and configuration handled correctly
210210
- **Idempotent**: Safe to run multiple times
211211
- **Declarative**: Describe desired state, not steps
212212

@@ -217,16 +217,28 @@ module openAi 'br/public:avm/res/cognitive-services/account:0.7.1' = {
217217
The environment name is used to generate unique resource names:
218218

219219
```bash
220-
# Resource naming pattern
221-
${environmentName}${resourceToken}-{service}
222-
223-
# Example with environmentName="lang-exam"
224-
lang-examxxxxxxxxxxxxx-openai
225-
lang-examxxxxxxxxxxxxx-search
226-
lang-examxxxxxxxxxxxxx-rg
220+
# Resource naming pattern (from infra/main.bicep)
221+
var prefix = '${environmentName}${resourceToken}'
227222
```
228223

229-
**Important**: Keep environment names short (7-10 characters) to avoid exceeding Azure resource name length limits.
224+
**Important**: Environment name must be **lowercase** and kept short (7-10 characters) to avoid exceeding Azure resource name length limits.
225+
226+
### Resource Naming Table
227+
228+
Based on the Bicep template (`infra/main.bicep`), here are the actual resource names created:
229+
230+
| Resource Type | Naming Pattern | Example (env="langexam") |
231+
|--------------|----------------|--------------------------|
232+
| Resource Group | `${prefix}-rg` | `langexamxxxxxxxxxxxxx-rg` |
233+
| OpenAI Service | `${prefix}-openai` | `langexamxxxxxxxxxxxxx-openai` |
234+
| AI Search | `${prefix}-search` | `langexamxxxxxxxxxxxxx-search` |
235+
| Container Registry | `${prefix}acr` (no hyphens) | `langexamxxxxxxxxxxxxxacr` |
236+
| Log Analytics | `${prefix}-logs` | `langexamxxxxxxxxxxxxx-logs` |
237+
| Container Apps Environment | `${prefix}-env` | `langexamxxxxxxxxxxxxx-env` |
238+
| Managed Identity | `${prefix}-identity` | `langexamxxxxxxxxxxxxx-identity` |
239+
| Container App | `app-${resourceToken}` | `app-xxxxxxxxxxxxx` |
240+
241+
Where `prefix = environmentName + resourceToken` (13-char hash).
230242

231243
### Resource Token
232244

@@ -246,6 +258,16 @@ The application is currently configured to deploy to specific regions with OpenA
246258

247259
These regions support the required GPT and embedding models. See [Azure OpenAI Model Availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) for the latest regional information.
248260

261+
**To update allowed regions**: Edit the `location` parameter's `@allowed` array in `infra/main.bicep` (lines 11-15):
262+
263+
```bicep
264+
@allowed([
265+
'eastus2'
266+
'swedencentral'
267+
])
268+
param location string
269+
```
270+
249271
## Monitoring and Troubleshooting
250272

251273
### View Application Logs
@@ -292,7 +314,7 @@ The resources created incur costs:
292314

293315
**Tip**: Delete resources when not in use:
294316
```bash
295-
azd down
317+
azd down --purge
296318
```
297319

298320
## Additional Resources

docs/04-testing-with-http-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ If answers are empty or low quality:
216216
```bash
217217
azd env get-values | grep INDEX_DOCUMENT_COUNT
218218
```
219-
Should show 262 documents.
219+
Should show 263 documents.
220220

221221
2. **Verify Azure AI Search connection**:
222222
- Check `AZURE_AISEARCH_ENDPOINT` in `.env`
@@ -251,7 +251,7 @@ See [Azure Identity Authentication](./05-azure-identity-authentication.md) for m
251251
1. **Use descriptive questions**: Clear, specific questions get better answers
252252
2. **Test incrementally**: Start with simple questions, then try complex ones
253253
3. **Check server logs**: Monitor console output for errors and performance
254-
4. **Wait for indexing**: Ensure all 262 documents are indexed before testing
254+
4. **Wait for indexing**: Ensure all 263 documents are indexed before testing
255255
5. **Version control**: Don't commit `.http` files with production URLs or sensitive data
256256

257257
## Creating Your Own Test Files

docs/05-azure-identity-authentication.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export async function azureADTokenProvider_OpenAI() {
7070
}
7171
```
7272

73+
**About the token provider**: The `azureADTokenProvider` is specific to third-party SDKs like LangChain that don't natively support Azure SDK authentication patterns. When using official Azure SDKs (like `@azure/search-documents`), you can pass the `DefaultAzureCredential` directly without a token provider. However, LangChain's `@langchain/openai` package requires a token provider function that returns a string token, hence this wrapper.
74+
7375
This token provider is used when initializing Azure OpenAI clients in LangChain:
7476

7577
**File**: `packages-v1/langgraph-agent/src/azure/llm.ts`

docs/07-azure-ai-search-vector-store.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This guide explains how the application uses Azure AI Search as a vector databas
1111
- **Scalability**: Handle millions of documents
1212

1313
This application uses Azure AI Search to:
14-
1. Store embeddings of PDF documents (262 documents)
14+
1. Store embeddings of PDF documents (263 documents)
1515
2. Perform similarity search to find relevant documents
1616
3. Provide context for the LangChain RAG (Retrieval Augmented Generation) system
1717

@@ -85,7 +85,7 @@ The application loads documents from the `packages-v1/langgraph-agent/data/` dir
8585
- **12 JSON files**: Structured data examples
8686
- **PDF files** (assumed): Employee handbook, benefits documentation
8787

88-
Total: **262 document chunks** after processing
88+
Total: **263 document chunks** after processing
8989

9090
### Loading Process
9191

@@ -185,11 +185,11 @@ Other search types available (not used in this sample):
185185
- **`SimilarityHybrid`**: Combines vector and keyword search
186186
- **`SemanticHybrid`**: Uses semantic ranking for better relevance
187187

188-
## Document Count: 262 Documents
188+
## Document Count: 263 Documents
189189

190190
### Why This Matters
191191

192-
The application needs **all 262 documents indexed** before the `/answer` endpoint works effectively:
192+
The application needs **all 263 documents indexed** before the `/answer` endpoint works effectively:
193193

194194
- **Incomplete index**: May return poor or irrelevant answers
195195
- **Complete index**: Provides comprehensive context for questions
@@ -202,7 +202,7 @@ azd env get-values | grep INDEX_
202202

203203
# Expected output:
204204
# INDEX_CREATED=true
205-
# INDEX_DOCUMENT_COUNT=262
205+
# INDEX_DOCUMENT_COUNT=263
206206
```
207207

208208
### Indexing Time
@@ -226,7 +226,7 @@ postdeploy:
226226
else
227227
npm run load_data
228228
azd env set INDEX_CREATED true
229-
azd env set INDEX_DOCUMENT_COUNT 262
229+
azd env set INDEX_DOCUMENT_COUNT 263
230230
fi
231231
```
232232
@@ -385,7 +385,7 @@ If queries return no documents:
385385
```bash
386386
azd env get-values | grep INDEX_DOCUMENT_COUNT
387387
```
388-
Should show 262.
388+
Should show 263.
389389

390390
3. **Verify authentication**: Ensure passwordless auth is working
391391

@@ -417,7 +417,7 @@ Azure AI Search pricing depends on:
417417
This sample uses:
418418
- **SKU**: Basic (~$75/month)
419419
- **Replicas**: 1 (no high availability)
420-
- **Partitions**: 1 (sufficient for 262 documents)
420+
- **Partitions**: 1 (sufficient for 263 documents)
421421

422422
**Cost optimization**:
423423
- Use Basic tier for development

docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ See [Azure Container Apps](./06-azure-container-apps.md) for details.
7474

7575
### Vector Store Indexing
7676

77-
The application loads **262 documents** into Azure AI Search as embedding vectors. You must wait for indexing to complete before using the `/answer` endpoint.
77+
The application loads **263 documents** into Azure AI Search as embedding vectors. You must wait for indexing to complete before using the `/answer` endpoint.
7878

7979
See [Azure AI Search Vector Store](./07-azure-ai-search-vector-store.md) for details.
8080

@@ -137,8 +137,8 @@ See [Azure Container Apps](./06-azure-container-apps.md) and [Azure AI Search Ve
137137

138138
### Empty or Poor Answers
139139

140-
- Wait for all 262 documents to be indexed
141-
- Check `INDEX_DOCUMENT_COUNT` equals 262
140+
- Wait for all 263 documents to be indexed
141+
- Check `INDEX_DOCUMENT_COUNT` equals 263
142142
- Verify Azure AI Search and OpenAI are accessible
143143
- Review application logs for errors
144144

@@ -165,7 +165,7 @@ See [Azure Container Apps](./06-azure-container-apps.md) and [Azure AI Search Ve
165165
┌─────────────────────────┐ ┌──────────────────────────┐
166166
│ Azure OpenAI │ │ Azure AI Search │
167167
│ ├─ GPT-4 (completion) │ │ ├─ Index: northwind │
168-
│ └─ Embeddings │ │ └─ 262 vector docs │
168+
│ └─ Embeddings │ │ └─ 263 vector docs │
169169
└─────────────────────────┘ └──────────────────────────┘
170170
```
171171

0 commit comments

Comments
 (0)