Skip to main content

Step 1: Install the SDK in your server app

Start by installing the Statsig Azure AI SDK. Depending on your language/framework you would use the right package manager to install the SDK in your project
  • NodeJS
npm i @statsig/azure-ai
```text
  </Tab>
  <Tab title="Python">
```shell
pip install azureai-statsig
```text
  </Tab>
  <Tab title=".NET">
```shell
dotnet add package StatsigAzureAI
```ruby
  </Tab>
</Tabs>

## Step 2: Create a model deployment in Azure AI Studio

Log into your Azure AI Studio console and create a new deployment that you'd like to use.

<Frame>
  <img src="/images/integrations/azureai/getting-started/3172d6f9-176e-4a3b-817f-3a5bd3af4291.png" alt="Azure AI Studio model deployment creation interface" />
</Frame>

Once confirmed, you will be taken to the details page of that model.  

<Frame>
  <img src="/images/integrations/azureai/getting-started/b8f46ed9-ce02-486f-b6f7-1d09f7b62f33.png" alt="Azure AI model deployment details page" />
</Frame>

Now, copy the **Target URI** (this will be your _endpoint_ in code) and the **Key** - you'll need this in the SDK to call the APIs.

## Step 3: Get Statsig server SDK key

<Info>
This guide assumes you have an existing Statsig account. Please go here to create a new free account if you don't already have one: https://statsig.com/signup
</Info>

Go to your **Project Settings** and choose the **Keys & Environments** tab on the left.  Scroll down to **API Keys** section and copy the Server Secret Key.  If one doesn't exist, you will have to create one, or ask your project admin to create one for you.

<Frame>
  <img src="/images/integrations/azureai/getting-started/f60f6f2b-60d0-4804-8db5-b82d4ac96bcf.png" alt="Statsig project settings API keys section" />
</Frame>


## Step 4: Initialize Azure AI Server

<Tabs>
  <Tab title="NodeJS">
```js
import { AzureAI } from "@statsig/azure-ai";

await AzureAI.initialize("<STATSIG_SERVER_KEY>");
```text
  </Tab>
  <Tab title="Python">
```python
AzureAI.initialize("<STATSIG_SERVER_KEY>")
```text
  </Tab>
  <Tab title=".NET">
```csharp
using Statsig;
using Statsig.AzureAI;

await Server.Initialize("<STATSIG_SERVER_KEY>");