> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure

> Deploy Chroma on Azure using Terraform.

export const Danger = ({title, children}) => <div className="my-6">
    <div className="relative pr-1.5 pb-1.5">
      <div className="absolute top-1.5 left-1.5 right-0 bottom-0 bg-red-500 dark:bg-red-600" />
      <div className="relative border border-black dark:border-gray-500 px-5 py-4 bg-white dark:bg-neutral-900">
        {title && <p className="block mb-2"><strong>{title}</strong></p>}
        {children}
      </div>
    </div>
  </div>;

export const Callout = ({title, children}) => <div className="my-6">
    <div className="relative pr-1.5 pb-1.5">
      <div className="absolute top-1.5 left-1.5 right-0 bottom-0 bg-blue-500 dark:bg-blue-600" />
      <div className="relative border border-black dark:border-gray-500 px-5 py-4 bg-white dark:bg-neutral-900">
        {title && <p className="block mb-2"><strong>{title}</strong></p>}
        {children}
      </div>
    </div>
  </div>;

<Callout>
  Chroma Cloud, our fully managed hosted service is here. [Sign up for free](https://trychroma.com/signup?utm_source=docs-azure).
</Callout>

## A Simple Azure Deployment

You can deploy Chroma on a long-running server, and connect to it
remotely.

For convenience, we have
provided a very simple Terraform configuration to experiment with
deploying Chroma to Azure.

<Danger>
  Chroma and its underlying database [need at least 2GB of RAM](/guides/performance/single-node#results-summary). When defining your VM size for the template in this example, make sure it meets this requirement.
</Danger>

<Danger>
  By default, this template saves all data on a single
  volume. When you delete or replace it, the data will disappear. For
  serious production use (with high availability, backups, etc.) please
  read and understand the Terraform template and use it as a basis
  for what you need, or reach out to the Chroma team for assistance.
</Danger>

### Step 1: Install Terraform

Download [Terraform](https://developer.hashicorp.com/terraform/install?product_intent=terraform) and follow the installation instructions for you OS.

### Step 2: Authenticate with Azure

```terminal theme={null}
az login
```

### Step 3: Configure your Azure Settings

Create a `chroma.tfvars` file. Use it to define the following variables for your Azure Resource Group name, VM size, and location. Note that this template creates a new resource group for your Chroma deployment.

```text theme={null}
resource_group_name = "your-azure-resource-group-name"
location            = "your-location"
machine_type        = "Standard_B1s"
```

### Step 4: Initialize and deploy with Terraform

Download our [Azure Terraform configuration](https://github.com/chroma-core/chroma/blob/main/deployments/azure/main.tf) to the same directory as your `chroma.tfvars` file. Then run the following commands to deploy your Chroma stack.

Initialize Terraform:

```terminal theme={null}
terraform init
```

Plan the deployment, and review it to ensure it matches your expectations:

```terminal theme={null}
terraform plan -var-file chroma.tfvars
```

Finally, apply the deployment:

```terminal theme={null}
terraform apply -var-file chroma.tfvars
```

After a few minutes, you can get the IP address of your instance with

```terminal theme={null}
terraform output -raw public_ip_address
```

### Step 5: Chroma Client Set-Up

<Tabs>
  <Tab title="Python" icon="python">
    Once your Azure VM instance is up and running with Chroma, all
    you need to do is configure your `HttpClient` to use the server's IP address and port
    `8000`. Since you are running a Chroma server on Azure, our [thin-client package](./python-thin-client) may be enough for your application.

    ```python theme={null}
    import chromadb

    chroma_client = chromadb.HttpClient(
        host="<Your Chroma instance IP>",
        port=8000
    )
    chroma_client.heartbeat()
    ```
  </Tab>

  <Tab title="TypeScript" icon="js">
    Once your Azure VM instance is up and running with Chroma, all
    you need to do is configure your `ChromaClient` to use the server's IP address and port
    `8000`.

    ```typescript theme={null}
    import { ChromaClient } from "chromadb";

    const chromaClient = new ChromaClient({
      host: "<Your Chroma instance IP>",
      port: 8000,
    });
    chromaClient.heartbeat();
    ```
  </Tab>

  <Tab title="Rust" icon="rust">
    Once your Azure VM instance is up and running with Chroma, you can point the Rust client at the server's address and port `8000`.

    ```rust theme={null}
    use chroma::{ChromaHttpClient, ChromaHttpClientOptions};

    let mut options = ChromaHttpClientOptions::default();
    options.endpoint = "http://<Your Chroma instance IP>:8000".parse()?;

    let chroma_client = ChromaHttpClient::new(options);
    chroma_client.heartbeat().await?;
    ```
  </Tab>
</Tabs>

### Step 5: Clean Up (optional).

To destroy the stack and remove all Azure resources, use the `terraform destroy` command.

```shell theme={null}
terraform destroy -var-file chroma.tfvars
```

<Danger>
  This will destroy all the data in your Chroma database,
  unless you've taken a snapshot or otherwise backed it up.
</Danger>

## Observability with Azure

Chroma is instrumented with [OpenTelemetry](https://opentelemetry.io/) hooks for observability. We currently only export OpenTelemetry [traces](https://opentelemetry.io/docs/concepts/signals/traces/). These should allow you to understand how requests flow through the system and quickly identify bottlenecks. Check out the [observability docs](./observability) for a full explanation of the available parameters.

To enable tracing on your Chroma server, simply define the following variables in your `chroma.tfvars`:

```text theme={null}
chroma_otel_collection_endpoint          = "api.honeycomb.com"
chroma_otel_service_name                 = "chromadb"
chroma_otel_collection_headers           = "{'x-honeycomb-team': 'abc'}"
```
