Skip to Content
GuidesDeploy a Play

Deploy a Play

Deploy a FrootAI solution play to Azure with Bicep infrastructure, health checks, evaluation gates, and cost tracking.

Prerequisites

RequirementVerifyMinimum Version
Azure CLIaz version2.60+
Bicep CLIaz bicep version0.25+
Azure subscriptionaz account showContributor role
Node.jsnode --version22+
az login az account set --subscription "YOUR_SUBSCRIPTION_ID"

Step 1: Pre-Deployment Checklist

# Validate Bicep compiles az bicep build -f solution-plays/01-enterprise-rag/infra/main.bicep # Validate all primitives npm run validate:primitives # Scan for leaked secrets bash hooks/fai-secrets-scanner/scan-secrets.sh

Step 2: Create the Resource Group

PLAY="01-enterprise-rag" ENV="dev" LOCATION="eastus2" RG="rg-frootai-${PLAY}-${ENV}" az group create --name "$RG" --location "$LOCATION" \ --tags play="$PLAY" environment="$ENV" managed-by="frootai"

Step 3: Preview with What-If

⚠️

Always Preview First

Never deploy without running what-if to check for unexpected resource deletions.

az deployment group what-if \ --resource-group "$RG" \ --template-file "solution-plays/${PLAY}/infra/main.bicep" \ --parameters "solution-plays/${PLAY}/infra/parameters.${ENV}.json" \ --mode Incremental

Step 4: Deploy Infrastructure

DEPLOY_NAME="frootai-${PLAY}-$(date +%Y%m%d-%H%M%S)" az deployment group create \ --resource-group "$RG" \ --template-file "solution-plays/${PLAY}/infra/main.bicep" \ --parameters "solution-plays/${PLAY}/infra/parameters.${ENV}.json" \ --name "$DEPLOY_NAME" --mode Incremental

Step 5: Deploy Application Code

For Container Apps:

ACR_NAME="acrfrootai${ENV}" az acr build --registry "$ACR_NAME" \ --image "frootai-${PLAY}:latest" \ "solution-plays/${PLAY}/"

Step 6: Health Checks

APP_URL=$(az deployment group show -g "$RG" -n "$DEPLOY_NAME" \ --query "properties.outputs.applicationUrl.value" -o tsv) curl -sf "${APP_URL}/health" | jq . # Expected: {"status":"healthy","version":"1.0.0"}

Step 7: Post-Deployment Evaluation

node engine/index.js "solution-plays/${PLAY}/fai-manifest.json" --eval

All guardrails must pass before the deployment is complete.

Cost Estimation

ResourceDev Cost/moProd Cost/mo
Azure OpenAI (GPT-4o-mini)~$15~$150
Azure AI Search~$70~$250
Container Apps~$0-20~$50-200
Total estimated~$90~$640

Rollback

# Redeploy previous version az deployment group create --resource-group "$RG" \ --template-file "solution-plays/${PLAY}/infra/main.bicep" \ --parameters "solution-plays/${PLAY}/infra/parameters.${ENV}.json" \ --name "rollback-$(date +%Y%m%d-%H%M%S)"

Troubleshooting

SymptomFix
InsufficientQuota on OpenAIRequest quota increase or switch region
Container App returns 502Check az containerapp logs show
Health check timeoutVerify VNet integration and DNS

See Also

Last updated on