| name | ai-foundry-operations |
| description | Azure AI Foundry — provisioning, model deployment, RAG configuration, and operational management. USE FOR: provision AI Foundry, deploy AI model, configure RAG, AI Foundry operations, OpenAI model deployment, AI workspace setup. DO NOT USE FOR: general Azure infrastructure (use azure-infrastructure), Terraform IaC (use terraform-cli), Kubernetes operations (use kubectl-cli). |
When to Use
- Provision Azure AI Foundry resources
- Deploy and manage OpenAI models
- Configure RAG pipelines with AI Search
- Monitor token usage and costs
- Test model endpoints
Prerequisites
- Azure CLI authenticated (
az login)
- Subscription with AI services quota
- Terraform H3 modules applied (or manual provisioning)
Provisioning
1. Create AI Foundry Resources (via Terraform)
cd terraform
terraform plan -var-file=environments/dev.tfvars -var="enable_h3=true" -out=tfplan
terraform apply tfplan
./scripts/platform-bootstrap.sh --horizon h3 --environment dev
2. Create Resources (via Azure CLI)
az cognitiveservices account create \
--name "${PROJECT}-${ENV}-openai" \
--resource-group "${RG_NAME}" \
--kind OpenAI \
--sku S0 \
--location eastus2 \
--custom-domain "${PROJECT}-${ENV}-openai" \
--tags environment="${ENV}" project="${PROJECT}"
az search service create \
--name "${PROJECT}-${ENV}-search" \
--resource-group "${RG_NAME}" \
--sku standard \
--partition-count 1 \
--replica-count 1
az cognitiveservices account deployment create \
--name "${PROJECT}-${ENV}-openai" \
--resource-group "${RG_NAME}" \
--deployment-name gpt-4o \
--model-name gpt-4o \
--model-version "2024-05-13" \
--model-format OpenAI \
--sku-capacity 30 \
--sku-name Standard
3. Configure Managed Identity Access
az role assignment create \
--assignee "${AKS_IDENTITY_PRINCIPAL_ID}" \
--role "Cognitive Services User" \
--scope "/subscriptions/${SUB_ID}/resourceGroups/${RG_NAME}/providers/Microsoft.CognitiveServices/accounts/${PROJECT}-${ENV}-openai"
az cognitiveservices account show \
--name "${PROJECT}-${ENV}-openai" \
--resource-group "${RG_NAME}" \
--query "properties.endpoint" -o tsv
Day-2 Operations
Resource Management
az ml workspace list -o table
az ml workspace show --name <workspace> --resource-group <rg>
az ml compute list --workspace-name <workspace> --resource-group <rg>
OpenAI Deployments
az cognitiveservices account list -o table
az cognitiveservices account deployment list \
--name <account> --resource-group <rg> -o table
az cognitiveservices usage list --location eastus2 -o table
Model Testing
curl -X POST "https://<endpoint>.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=2024-02-15-preview" \
-H "Content-Type: application/json" \
-H "api-key: ${OPENAI_API_KEY}" \
-d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":100}'
curl -X POST "https://<endpoint>.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=2024-02-15-preview" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-d '{"messages":[{"role":"user","content":"Hello"}]}'
Project Files Reference
- Terraform module:
terraform/modules/ai-foundry/
- Golden Path templates:
golden-paths/h3-innovation/ (7 AI templates)
Best Practices
- Configure content safety filters on all deployments
- Implement rate limiting and retry logic
- Use managed identity for authentication (never API keys in code)
- Monitor token usage and set cost alerts
- Enable diagnostic logging for compliance
- Use private endpoints for production
- Deploy models in LATAM-nearest region with quota
Output Format
- Command executed
- Resource status
- Deployment details
- Recommendations
Integration with Agents
Used by: @deploy, @azure-portal-deploy