Skip to content

Azure-Samples/documentdb-samples

Azure DocumentDB Samples

This repository contains code samples for working with Azure DocumentDB, including AI-powered vector search implementations across multiple programming languages.

Prerequisites

Quick Start

1. Deploy Infrastructure with Azure Developer CLI

Deploy the Azure DocumentDB cluster, Azure OpenAI, and other required resources:

azd auth login
azd up

This command will:

  • Prompt you to create a new Azure environment
  • Provision all infrastructure resources in your Azure subscription
  • Generate a .env file in the root directory with all necessary connection strings and credentials

2. Navigate to Your Sample Language

Choose your preferred programming language and navigate to the sample directory:

# For .NET
cd ai/vector-search-dotnet

# For Python
cd ai/vector-search-python

# For Go
cd ai/vector-search-go

# For TypeScript
cd ai/vector-search-typescript

3. Configure Environment Variables

Copy the .env file from the root directory to your language sample folder:

cp ../../.env .env

Alternatively, you can keep the .env in the root and run the samples from there.

4. Run Your Sample

Follow the language-specific instructions:

  • .NET - Vector search sample using .NET 8.0
  • Python - Vector search implementation in Python
  • Go - Vector search examples using Go
  • TypeScript - Vector search with TypeScript/Node.js

Each sample demonstrates how to generate embeddings, create vector indexes, and perform semantic similarity searches with hotel data.

Cleanup

To delete all provisioned Azure resources:

azd down

Resources

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6