Skip to content

Commit 2fca2bc

Browse files
diberryCopilot
andcommitted
fix: em dash spacing + Bicep param validation (round 3)
- Remove spaces around 13 em dashes in README per Microsoft Learn standards - Add @minlength(36)/@maxlength(36) to deploymentUserPrincipalId in main.bicep to catch missing AZURE_PRINCIPAL_ID early with clear validation error Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f6f7355 commit 2fca2bc

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

samples/features/vector-search/infra/main.bicep

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ param environmentName string
2626
})
2727
param location string
2828

29-
@description('Id of the principal to assign database and application roles.')
29+
@description('Object ID of the principal to assign database and application roles. Required — must be set via AZURE_PRINCIPAL_ID. Expected as UUID (36 characters).')
30+
@minLength(36)
31+
@maxLength(36)
3032
param deploymentUserPrincipalId string = ''
3133

3234
@description('Client IP address for SQL firewall rule (for local development).')

samples/features/vector-search/vector-search-query-typescript/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ This sample supports two algorithms, selected via the `VECTOR_SEARCH_ALGORITHM`
3232
| **Best for** | < 50,000 rows, prototyping | > 10,000 rows, production |
3333

3434
> [!IMPORTANT]
35-
> DiskANN index creation requires at least **1,000 rows** with non-null vectors. The 50-hotel sample dataset is too smallload a larger dataset before using `VECTOR_SEARCH_ALGORITHM=diskann`.
35+
> DiskANN index creation requires at least **1,000 rows** with non-null vectors. The 50-hotel sample dataset is too smallload a larger dataset before using `VECTOR_SEARCH_ALGORITHM=diskann`.
3636
3737
## Prerequisites
3838

39-
- **Azure subscription**[Create one free](https://azure.microsoft.com/free/)
40-
- **Azure SQL Database** with native vector support[Quickstart: Create a single database](https://learn.microsoft.com/azure/azure-sql/database/single-database-create-quickstart)
41-
- **Azure OpenAI resource** with a `text-embedding-3-small` deployment[Create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource)
42-
- **Node.js 20+**[Download Node.js](https://nodejs.org/)
43-
- **Azure CLI**[Install the Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli), signed in with `az login`
39+
- **Azure subscription**[Create one free](https://azure.microsoft.com/free/)
40+
- **Azure SQL Database** with native vector support[Quickstart: Create a single database](https://learn.microsoft.com/azure/azure-sql/database/single-database-create-quickstart)
41+
- **Azure OpenAI resource** with a `text-embedding-3-small` deployment[Create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource)
42+
- **Node.js 20+**[Download Node.js](https://nodejs.org/)
43+
- **Azure CLI**[Install the Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli), signed in with `az login`
4444

4545
> [!IMPORTANT]
4646
> Your Azure identity must be configured as a **Microsoft Entra admin** on the Azure SQL server. The `azd up` deployment sets this automatically using `deploymentUserPrincipalId`. For the Azure OpenAI resource, you need the **Cognitive Services OpenAI User** role.
@@ -220,7 +220,7 @@ const response = await openaiClient.embeddings.create({
220220

221221
### Vector similarity search
222222

223-
**Exact search (default)**The `VECTOR_DISTANCE()` function computes cosine distance between the query vector and all stored embeddings:
223+
**Exact search (default)**The `VECTOR_DISTANCE()` function computes cosine distance between the query vector and all stored embeddings:
224224

225225
```sql
226226
SELECT TOP 3
@@ -230,7 +230,7 @@ FROM dbo.hotels_typescript
230230
ORDER BY distance;
231231
```
232232

233-
**Approximate search (DiskANN)**The `VECTOR_SEARCH()` function uses a DiskANN index for 10–100× faster queries on large datasets:
233+
**Approximate search (DiskANN)**The `VECTOR_SEARCH()` function uses a DiskANN index for 10–100× faster queries on large datasets:
234234

235235
```sql
236236
SELECT TOP 3
@@ -275,13 +275,13 @@ To avoid ongoing charges, delete the Azure resources you created if they were on
275275

276276
### Authentication failures
277277

278-
**"Login failed"**Ensure your Azure identity is set as Microsoft Entra admin on the SQL server. Run `az login` to refresh your credentials.
278+
**"Login failed"**Ensure your Azure identity is set as Microsoft Entra admin on the SQL server. Run `az login` to refresh your credentials.
279279

280-
**"AuthenticationError" from Azure OpenAI**Verify you have the **Cognitive Services OpenAI User** role on the Azure OpenAI resource. Check the endpoint URL and deployment name in your `.env` file.
280+
**"AuthenticationError" from Azure OpenAI**Verify you have the **Cognitive Services OpenAI User** role on the Azure OpenAI resource. Check the endpoint URL and deployment name in your `.env` file.
281281

282282
### Firewall errors
283283

284-
**"Cannot open server"**Your client IP may not be in the SQL firewall rules. Add it:
284+
**"Cannot open server"**Your client IP may not be in the SQL firewall rules. Add it:
285285

286286
```bash
287287
az sql server firewall-rule create \
@@ -291,15 +291,15 @@ az sql server firewall-rule create \
291291

292292
### DiskANN errors
293293

294-
**"DiskANN index requires at least 1,000 rows"**The 50-hotel sample dataset is too small for DiskANN. The sample automatically detects this and falls back to exact nearest-neighbor search using `VECTOR_DISTANCE` without a vector index. To use DiskANN, load a larger dataset first.
294+
**"DiskANN index requires at least 1,000 rows"**The 50-hotel sample dataset is too small for DiskANN. The sample automatically detects this and falls back to exact nearest-neighbor search using `VECTOR_DISTANCE` without a vector index. To use DiskANN, load a larger dataset first.
295295

296296
### Vector dimension errors
297297

298298
**"Invalid or missing vector dimensions"**—The precomputed embeddings in `HotelsData_Vector.json` must use 1536 dimensions (matching `text-embedding-3-small`). Re-run `npm run embed` if you changed the embedding model.
299299

300300
## Explore your database
301301

302-
To browse tables, run queries, and inspect vector data directly from VS Code, install the [SQL Server (mssql)](https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql) extension. Connect using your Azure AD credentialsthe same authentication the sample uses.
302+
To browse tables, run queries, and inspect vector data directly from VS Code, install the [SQL Server (mssql)](https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql) extension. Connect using your Azure AD credentialsthe same authentication the sample uses.
303303

304304
## Related content
305305

0 commit comments

Comments
 (0)