Azure Function Server Setup

Deploy AI IN A BOX as a serverless Azure Function for automatic scaling and minimal maintenance.

Prerequisites

  • Azure subscription
  • Azure CLI or Azure Portal access
  • AI IN A BOX server code (from us, requires NDA)
  • LLM API key (OpenAI, Azure OpenAI, etc.)

How It Works

AI IN A BOX is stateless. ServiceNow sends all configuration with each request:

  • LLM provider URL and API key
  • Model name and parameters
  • Callback URL for streaming responses

The Azure Function needs minimal configuration - just Basic Auth credentials for security.

Deployment Steps

1. Create Function App

# Create resource group
az group create --name aiinabox-rg --location eastus

# Create storage account
az storage account create \
  --name aiinaboxstorage \
  --resource-group aiinabox-rg \
  --location eastus \
  --sku Standard_LRS

# Create Function App
az functionapp create \
  --resource-group aiinabox-rg \
  --consumption-plan-location eastus \
  --runtime node \
  --runtime-version 18 \
  --functions-version 4 \
  --name your-aiinabox-server \
  --storage-account aiinaboxstorage

2. Deploy the Code

cd ai-in-a-box-serverless-azure
func azure functionapp publish your-aiinabox-server

3. Configure Auth

az functionapp config appsettings set \
  --name your-aiinabox-server \
  --resource-group aiinabox-rg \
  --settings \
    AIIAB_USERNAME=your-username \
    AIIAB_PASSWORD=your-password

4. Configure ServiceNow

In ServiceNow, go to AI IN A BOX > Command Center and configure:

  • AI IN A BOX Server URL: https://your-aiinabox-server.azurewebsites.net
  • AI IN A BOX Auth: your-username:your-password
  • LLM URL: Your LLM provider endpoint (e.g., https://api.openai.com/v1)
  • LLM API Key: Your API key for the LLM provider
  • Model: Model name (e.g., gpt-4)

The Command Center automatically checks server connectivity on page load.

Troubleshooting

Connection fails from ServiceNow

  • Verify the Server URL is correct
  • Check Basic Auth credentials match
  • Ensure the Function App is running: az functionapp show --name your-aiinabox-server --resource-group aiinabox-rg

LLM errors

  • Check your LLM API key is valid in ServiceNow configuration
  • Verify the LLM URL is correct
  • Test your LLM key directly with the provider

View logs

az functionapp log tail --name your-aiinabox-server --resource-group aiinabox-rg

Support