Skip to content

Add Azure SQL vector search TypeScript quickstart sample#1479

Draft
diberry wants to merge 1 commit intomicrosoft:masterfrom
diberry:squad/vector-search-typescript
Draft

Add Azure SQL vector search TypeScript quickstart sample#1479
diberry wants to merge 1 commit intomicrosoft:masterfrom
diberry:squad/vector-search-typescript

Conversation

@diberry
Copy link
Copy Markdown

@diberry diberry commented Apr 23, 2026

Azure SQL Vector Search — TypeScript Quickstart Sample

Adds a new TypeScript quickstart sample demonstrating Azure SQL Database's native VECTOR type with Azure OpenAI embeddings.

What's included

  • TypeScript sample (�ector-search-query-typescript/) using tedious + Azure OpenAI SDK
  • Bicep infrastructure (infra/) — Azure SQL, Azure OpenAI, managed identity, RBAC
  • azd-compatible project structure with azure.yaml
  • Pre-computed embeddings loaded from JSON data file
  • Batched parameterized inserts (10 rows/batch) for efficient data loading
  • Two search algorithms: exact nearest neighbor and DiskANN approximate search
  • Passwordless authentication via DefaultAzureCredential

Key technical decisions

  • Uses tedious native transaction methods (not raw SQL BEGIN/COMMIT) for correct sp_executesql scope handling
  • Batched inserts with numbered parameters to minimize round-trips (5 instead of 50)
  • Table name validation reserves 13 chars for index naming convention (ix_{table}_embedding)
  • Requires Node.js >= 20.6.0 for --env-file flag support
  • Uses openai package (not retired @azure/openai) for Azure OpenAI access

Testing

Sample has been verified end-to-end against a live Azure SQL Database with vector search enabled.

@diberry diberry force-pushed the squad/vector-search-typescript branch 3 times, most recently from 317e362 to 8ce7c4d Compare April 23, 2026 12:22
Add a complete TypeScript sample demonstrating vector search with Azure SQL Database:
- Azure OpenAI text-embedding-3-small for generating embeddings
- VECTOR_DISTANCE for similarity search with DiskANN index
- Azure Identity (DefaultAzureCredential) for passwordless auth
- Bicep infrastructure for Azure SQL + OpenAI provisioning
- CI workflow for build validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/vector-search-typescript branch from 2fca2bc to 76eafd9 Compare April 23, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant