From 375379b067f320d420b7beb6da357035167e8cd0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 11:38:24 +0000 Subject: [PATCH 1/6] Update default model from gpt-4o-mini to gpt-5-mini Updated configuration files to use gpt-5-mini as the default agent model: - scripts/set_default_models.sh: Updated AZURE_AI_AGENT_DEPLOYMENT_NAME and AZURE_AI_AGENT_MODEL_NAME - scripts/set_default_models.ps1: Updated AZURE_AI_AGENT_DEPLOYMENT_NAME and AZURE_AI_AGENT_MODEL_NAME - infra/main.bicep: Updated agentModelName and agentDeploymentName parameters - infra/main.parameters.json: Updated default values for agent deployment and model name This aligns the codebase with the GPT-5 mini deployment currently configured in Azure AI Foundry. --- infra/main.bicep | 4 ++-- infra/main.parameters.json | 4 ++-- scripts/set_default_models.ps1 | 4 ++-- scripts/set_default_models.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/infra/main.bicep b/infra/main.bicep index 24484900..62525bc3 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -62,9 +62,9 @@ param aiAgentID string = '' @description('ID of the existing agent') param azureExistingAgentId string = '' @description('Name of the chat model to deploy') -param agentModelName string = 'gpt-4o-mini' +param agentModelName string = 'gpt-5-mini' @description('Name of the model deployment') -param agentDeploymentName string = 'gpt-4o-mini' +param agentDeploymentName string = 'gpt-5-mini' @description('Version of the chat model to deploy') // See version availability in this table: diff --git a/infra/main.parameters.json b/infra/main.parameters.json index 75f41629..41d779bf 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -60,13 +60,13 @@ "value": "${AZURE_EXISTING_AGENT_ID}" }, "agentDeploymentName": { - "value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-4o-mini}" + "value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-5-mini}" }, "agentModelFormat": { "value": "${AZURE_AI_AGENT_MODEL_FORMAT=OpenAI}" }, "agentModelName": { - "value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-4o-mini}" + "value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-5-mini}" }, "agentModelVersion": { "value": "${AZURE_AI_AGENT_MODEL_VERSION=2024-07-18}" diff --git a/scripts/set_default_models.ps1 b/scripts/set_default_models.ps1 index a3db2f67..e6a5f5f3 100644 --- a/scripts/set_default_models.ps1 +++ b/scripts/set_default_models.ps1 @@ -25,8 +25,8 @@ $defaultEnvVars = @{ AZURE_AI_EMBED_MODEL_VERSION = '1' AZURE_AI_EMBED_DEPLOYMENT_SKU = 'Standard' AZURE_AI_EMBED_DEPLOYMENT_CAPACITY = '50' - AZURE_AI_AGENT_DEPLOYMENT_NAME = 'gpt-4o-mini' - AZURE_AI_AGENT_MODEL_NAME = 'gpt-4o-mini' + AZURE_AI_AGENT_DEPLOYMENT_NAME = 'gpt-5-mini' + AZURE_AI_AGENT_MODEL_NAME = 'gpt-5-mini' AZURE_AI_AGENT_MODEL_VERSION = '2024-07-18' AZURE_AI_AGENT_MODEL_FORMAT = 'OpenAI' AZURE_AI_AGENT_DEPLOYMENT_SKU = 'GlobalStandard' diff --git a/scripts/set_default_models.sh b/scripts/set_default_models.sh index 4a1f77f0..70b5f388 100755 --- a/scripts/set_default_models.sh +++ b/scripts/set_default_models.sh @@ -30,8 +30,8 @@ declare -A defaultEnvVars=( [AZURE_AI_EMBED_MODEL_VERSION]="1" [AZURE_AI_EMBED_DEPLOYMENT_SKU]="Standard" [AZURE_AI_EMBED_DEPLOYMENT_CAPACITY]="50" - [AZURE_AI_AGENT_DEPLOYMENT_NAME]="gpt-4o-mini" - [AZURE_AI_AGENT_MODEL_NAME]="gpt-4o-mini" + [AZURE_AI_AGENT_DEPLOYMENT_NAME]="gpt-5-mini" + [AZURE_AI_AGENT_MODEL_NAME]="gpt-5-mini" [AZURE_AI_AGENT_MODEL_VERSION]="2024-07-18" [AZURE_AI_AGENT_MODEL_FORMAT]="OpenAI" [AZURE_AI_AGENT_DEPLOYMENT_SKU]="GlobalStandard" From 2fb47dafdd15ecd1369e4928a7a987c5dfaf1411 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 12:03:11 +0000 Subject: [PATCH 2/6] Add GitHub Actions setup documentation and scripts - Added GITHUB_ACTIONS_SETUP.md: Complete guide for setting up automated deployment - Added scripts/setup_github_actions.sh: Helper script to gather Azure resource info - Added scripts/create_federated_credential.sh: Script to create federated credentials These files help configure GitHub Actions workflows for automated deployment to Azure. --- GITHUB_ACTIONS_SETUP.md | 231 ++++++++++++++++++++ scripts/create_federated_credential.sh | 24 +++ scripts/setup_github_actions.sh | 278 +++++++++++++++++++++++++ 3 files changed, 533 insertions(+) create mode 100644 GITHUB_ACTIONS_SETUP.md create mode 100755 scripts/create_federated_credential.sh create mode 100755 scripts/setup_github_actions.sh diff --git a/GITHUB_ACTIONS_SETUP.md b/GITHUB_ACTIONS_SETUP.md new file mode 100644 index 00000000..36fc78e5 --- /dev/null +++ b/GITHUB_ACTIONS_SETUP.md @@ -0,0 +1,231 @@ +# GitHub Actions Setup Guide + +This guide will help you set up automated deployment to Azure using GitHub Actions. + +## 📋 Prerequisites Completed ✅ + +- ✅ App Registration created +- ✅ Contributor role assigned to subscription +- ✅ App ID: `db57485e-6284-434d-ba83-e8fb848cc01d` +- ✅ Tenant ID: `b75007f5-364a-4c13-816e-74aacedc01a5` + +--- + +## Step 1: Create Federated Credential + +Run this command in **Azure Cloud Shell** or your local terminal (with Azure CLI): + +```bash +az ad app federated-credential create \ + --id db57485e-6284-434d-ba83-e8fb848cc01d \ + --parameters '{ + "name": "Ksenia-personal-agent-main", + "issuer": "https://token.actions.githubusercontent.com", + "subject": "repo:Skie-Art/Ksenia-personal-agent:ref:refs/heads/main", + "audiences": ["api://AzureADTokenExchange"], + "description": "GitHub Actions deployment for main branch" + }' +``` + +**Expected output:** Success message or "already exists" (both are fine) + +--- + +## Step 2: Enable GitHub Actions + +1. Go to: https://github.com/Skie-Art/Ksenia-personal-agent/actions +2. Click **"I understand my workflows, go ahead and enable them"** + +--- + +## Step 3: Gather Your Azure Resource Information + +You need to find these values from your Azure Portal: + +### Option A: Use Azure Cloud Shell Script + +Run the helper script from your Cloud Shell: +```bash +./scripts/setup_github_actions.sh +``` + +### Option B: Manually Gather Information + +Go to **Azure Portal** → Your Resource Group and note down: + +1. **AI Project name** (from AI Foundry) +2. **Resource Group name** +3. **Container Registry name** +4. **Storage Account name** +5. **Key Vault name** +6. **AI Services name** +7. **Agent ID** (from AI Foundry → Agents) + +--- + +## Step 4: Set GitHub Repository Variables + +Go to: https://github.com/Skie-Art/Ksenia-personal-agent/settings/variables/actions + +Click **"New repository variable"** and add each variable below: + +### Required Variables (Copy and fill in your values) + +``` +# Authentication +AZURE_CLIENT_ID = db57485e-6284-434d-ba83-e8fb848cc01d +AZURE_TENANT_ID = b75007f5-364a-4c13-816e-74aacedc01a5 +AZURE_SUBSCRIPTION_ID = + +# Environment +AZURE_ENV_NAME = prod +AZURE_LOCATION = # e.g., eastus +AZURE_RESOURCE_GROUP = + +# AI Resources +AZURE_AIPROJECT_NAME = +AZURE_AISERVICES_NAME = + +# Infrastructure +AZURE_CONTAINER_REGISTRY_NAME = +AZURE_KEYVAULT_NAME = +AZURE_STORAGE_ACCOUNT_NAME = + +# Configuration Flags +USE_CONTAINER_REGISTRY = true +USE_APPLICATION_INSIGHTS = false +USE_AZURE_AI_SEARCH_SERVICE = false + +# Agent Configuration (GPT-5 mini!) +AZURE_AI_AGENT_NAME = agent-template-assistant +AZURE_EXISTING_AGENT_ID = +AZURE_AI_AGENT_DEPLOYMENT_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_FORMAT = OpenAI +AZURE_AI_AGENT_MODEL_VERSION = 2024-07-18 +AZURE_AI_AGENT_DEPLOYMENT_SKU = GlobalStandard +AZURE_AI_AGENT_DEPLOYMENT_CAPACITY = 80 + +# Embedding Model +AZURE_AI_EMBED_DEPLOYMENT_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_FORMAT = OpenAI +AZURE_AI_EMBED_MODEL_VERSION = 1 +AZURE_AI_EMBED_DEPLOYMENT_SKU = Standard +AZURE_AI_EMBED_DEPLOYMENT_CAPACITY = 50 + +# Existing Project +AZURE_EXISTING_AIPROJECT_RESOURCE_ID = +AZURE_EXISTING_AIPROJECT_ENDPOINT = +``` + +### Optional Variables (if using AI Search or App Insights) + +``` +# Optional: AI Search +AZURE_SEARCH_SERVICE_NAME = + +# Optional: Monitoring +AZURE_APPLICATION_INSIGHTS_NAME = +AZURE_LOG_ANALYTICS_WORKSPACE_NAME = +``` + +--- + +## Step 5: Test Your Deployment + +1. Go to: https://github.com/Skie-Art/Ksenia-personal-agent/actions +2. Click on **"Deploy to Azure"** workflow +3. Click **"Run workflow"** → Select `main` branch → **"Run workflow"** +4. Watch the deployment progress! + +--- + +## 🔍 How to Find Your Azure Resource Information + +### Find Subscription ID: +```bash +az account show --query id -o tsv +``` + +Or in Portal: **Subscriptions** → Click your subscription → Copy **Subscription ID** + +### Find AI Project Endpoint: +Portal: **AI Foundry** → Your Project → **Overview** → Copy **Project endpoint** + +Format: `https://.cognitiveservices.azure.com/` + +### Find AI Project Resource ID: +Portal: **AI Foundry** → Your Project → **Properties** → Copy **Resource ID** + +Format: `/subscriptions//resourceGroups//providers/Microsoft.MachineLearningServices/workspaces/` + +### Find Agent ID: +Portal: **AI Foundry** → Your Project → **Agents** → Click your agent → Copy **Agent ID** + +--- + +## 🎯 What Each Workflow Does + +### 1. `azure-dev.yml` - Main Deployment +- **Triggers:** Push to main OR manual run +- **Actions:** + - Builds Docker container + - Pushes to Azure Container Registry + - Deploys to Azure Container Apps + - Updates your agent application + +### 2. `ai-evaluation.yaml` - Agent Testing +- **Triggers:** Push to main OR manual run +- **Actions:** + - Runs automated evaluations on your agent + - Tests quality, safety, and performance + - Reports results + +### 3. `template-validation.yml` - Infrastructure Validation +- **Triggers:** Manual run only +- **Actions:** + - Validates Bicep templates + - Checks infrastructure configuration + +--- + +## 🚨 Troubleshooting + +### Error: "No permission to access resource" +- Make sure the service principal has **Contributor** role on your subscription +- Verify in: Portal → Subscriptions → Access Control (IAM) + +### Error: "Federated credential not found" +- Rerun the federated credential creation command from Step 1 +- Wait 5-10 minutes for Azure to propagate the credential + +### Error: "Resource not found" +- Double-check all your variable names match exactly +- Verify resources exist in the Azure Portal + +### Workflow doesn't trigger +- Make sure workflows are enabled in your repo +- Check that you're pushing to the `main` branch + +--- + +## ✅ Checklist + +- [ ] Federated credential created (Step 1) +- [ ] GitHub Actions enabled (Step 2) +- [ ] All Azure resource information gathered (Step 3) +- [ ] All GitHub variables configured (Step 4) +- [ ] Test deployment run successfully (Step 5) + +--- + +## 📚 Resources + +- [Azure Federated Credentials](https://learn.microsoft.com/azure/developer/github/connect-from-azure) +- [GitHub Actions Variables](https://docs.github.com/en/actions/learn-github-actions/variables) +- [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/) + +--- + +**Need help?** Open an issue at: https://github.com/Skie-Art/Ksenia-personal-agent/issues diff --git a/scripts/create_federated_credential.sh b/scripts/create_federated_credential.sh new file mode 100755 index 00000000..fae7e50a --- /dev/null +++ b/scripts/create_federated_credential.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Quick script to create the federated credential +# Run this in Azure Cloud Shell or your local terminal with Azure CLI + +echo "Creating federated credential for GitHub Actions..." + +az ad app federated-credential create \ + --id db57485e-6284-434d-ba83-e8fb848cc01d \ + --parameters '{ + "name": "Ksenia-personal-agent-main", + "issuer": "https://token.actions.githubusercontent.com", + "subject": "repo:Skie-Art/Ksenia-personal-agent:ref:refs/heads/main", + "audiences": ["api://AzureADTokenExchange"], + "description": "GitHub Actions deployment for main branch" + }' + +echo "" +echo "✅ Federated credential created successfully!" +echo "" +echo "Next steps:" +echo "1. Enable GitHub Actions in your repo" +echo "2. Set up GitHub repository variables" +echo "3. See GITHUB_ACTIONS_SETUP.md for detailed instructions" diff --git a/scripts/setup_github_actions.sh b/scripts/setup_github_actions.sh new file mode 100755 index 00000000..162e319a --- /dev/null +++ b/scripts/setup_github_actions.sh @@ -0,0 +1,278 @@ +#!/bin/bash + +set -e + +echo "🚀 GitHub Actions Setup for Azure Deployment" +echo "==============================================" +echo "" + +# App Registration Details +APP_ID="db57485e-6284-434d-ba83-e8fb848cc01d" +TENANT_ID="b75007f5-364a-4c13-816e-74aacedc01a5" + +# GitHub Repository Details +GITHUB_ORG="Skie-Art" +GITHUB_REPO="Ksenia-personal-agent" + +echo "📋 Step 1: Creating Federated Credential for GitHub Actions" +echo "------------------------------------------------------------" + +# Create federated credential for main branch +echo "Creating federated credential for branch: main" + +CREDENTIAL_NAME="${GITHUB_REPO}-main" + +az ad app federated-credential create \ + --id "$APP_ID" \ + --parameters "{ + \"name\": \"$CREDENTIAL_NAME\", + \"issuer\": \"https://token.actions.githubusercontent.com\", + \"subject\": \"repo:${GITHUB_ORG}/${GITHUB_REPO}:ref:refs/heads/main\", + \"audiences\": [\"api://AzureADTokenExchange\"], + \"description\": \"GitHub Actions deployment for main branch\" + }" 2>/dev/null || echo "⚠️ Federated credential may already exist" + +echo "✅ Federated credential configured" +echo "" + +echo "📋 Step 2: Gathering Azure Resource Information" +echo "------------------------------------------------" + +# Check if logged in +if ! az account show &>/dev/null; then + echo "🔐 Not logged in to Azure. Please login..." + az login --tenant "$TENANT_ID" +fi + +# Get subscription ID +SUBSCRIPTION_ID=$(az account show --query id -o tsv) +echo "Subscription ID: $SUBSCRIPTION_ID" + +# Try to detect existing resources +echo "" +echo "🔍 Detecting existing Azure resources..." +echo "" + +# Look for AI Foundry projects +echo "Looking for Azure AI Foundry projects..." +AI_PROJECTS=$(az resource list --resource-type "Microsoft.MachineLearningServices/workspaces" --query "[].{name:name, group:resourceGroup, location:location}" -o tsv 2>/dev/null || echo "") + +if [ -n "$AI_PROJECTS" ]; then + echo "Found AI Foundry projects:" + echo "$AI_PROJECTS" | nl + echo "" + read -p "Enter the line number of your AI Project (or press Enter to enter manually): " PROJECT_CHOICE + + if [ -n "$PROJECT_CHOICE" ]; then + PROJECT_INFO=$(echo "$AI_PROJECTS" | sed -n "${PROJECT_CHOICE}p") + AIPROJECT_NAME=$(echo "$PROJECT_INFO" | awk '{print $1}') + RESOURCE_GROUP=$(echo "$PROJECT_INFO" | awk '{print $2}') + LOCATION=$(echo "$PROJECT_INFO" | awk '{print $3}') + + echo "Selected: $AIPROJECT_NAME in $RESOURCE_GROUP" + + # Get project endpoint + PROJECT_ENDPOINT=$(az ml workspace show -n "$AIPROJECT_NAME" -g "$RESOURCE_GROUP" --query "discoveryUrl" -o tsv 2>/dev/null | sed 's/\/discovery$//' || echo "") + + # Get AI Project resource ID + PROJECT_RESOURCE_ID=$(az resource show -g "$RESOURCE_GROUP" -n "$AIPROJECT_NAME" --resource-type "Microsoft.MachineLearningServices/workspaces" --query id -o tsv 2>/dev/null || echo "") + fi +fi + +# Manual entry if needed +if [ -z "$AIPROJECT_NAME" ]; then + echo "" + read -p "Enter your Azure AI Project name: " AIPROJECT_NAME + read -p "Enter your Resource Group name: " RESOURCE_GROUP + read -p "Enter your Azure location (e.g., eastus): " LOCATION +fi + +# Get other resources in the resource group +echo "" +echo "🔍 Finding resources in resource group: $RESOURCE_GROUP" + +# Container Registry +ACR_NAME=$(az acr list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "Container Registry: ${ACR_NAME:-Not found}" + +# Storage Account +STORAGE_NAME=$(az storage account list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "Storage Account: ${STORAGE_NAME:-Not found}" + +# Key Vault +KEYVAULT_NAME=$(az keyvault list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "Key Vault: ${KEYVAULT_NAME:-Not found}" + +# AI Services +AI_SERVICES_NAME=$(az cognitiveservices account list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "AI Services: ${AI_SERVICES_NAME:-Not found}" + +# AI Search (optional) +SEARCH_NAME=$(az search service list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "AI Search: ${SEARCH_NAME:-Not found (optional)}" + +# Application Insights (optional) +APP_INSIGHTS_NAME=$(az monitor app-insights component list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "Application Insights: ${APP_INSIGHTS_NAME:-Not found (optional)}" + +# Log Analytics Workspace (optional) +LOG_ANALYTICS_NAME=$(az monitor log-analytics workspace list -g "$RESOURCE_GROUP" --query "[0].name" -o tsv 2>/dev/null || echo "") +echo "Log Analytics: ${LOG_ANALYTICS_NAME:-Not found (optional)}" + +echo "" +echo "📋 Step 3: Agent Information" +echo "----------------------------" +read -p "Enter your Agent ID from Azure AI Foundry: " AGENT_ID +read -p "Enter your Agent Name (default: agent-template-assistant): " AGENT_NAME +AGENT_NAME=${AGENT_NAME:-agent-template-assistant} + +echo "" +echo "📋 Step 4: Configuration" +echo "------------------------" +read -p "Are you using AI Search? (yes/no, default: no): " USE_SEARCH +USE_SEARCH=${USE_SEARCH:-no} +USE_AI_SEARCH=$([ "$USE_SEARCH" = "yes" ] && echo "true" || echo "false") + +read -p "Are you using Application Insights? (yes/no, default: yes): " USE_INSIGHTS +USE_INSIGHTS=${USE_INSIGHTS:-yes} +USE_APP_INSIGHTS=$([ "$USE_INSIGHTS" = "yes" ] && echo "true" || echo "false") + +echo "" +echo "✅ Configuration complete!" +echo "" +echo "==========================================" +echo "📝 GitHub Repository Variables to Set" +echo "==========================================" +echo "" +echo "Go to: https://github.com/$GITHUB_ORG/$GITHUB_REPO/settings/variables/actions" +echo "" +echo "Click 'New repository variable' and add each of these:" +echo "" + +cat << EOF +# Authentication +AZURE_CLIENT_ID = $APP_ID +AZURE_TENANT_ID = $TENANT_ID +AZURE_SUBSCRIPTION_ID = $SUBSCRIPTION_ID + +# Environment +AZURE_ENV_NAME = prod +AZURE_LOCATION = $LOCATION +AZURE_RESOURCE_GROUP = $RESOURCE_GROUP + +# AI Resources +AZURE_AIPROJECT_NAME = $AIPROJECT_NAME +${AIHUB_NAME:+AZURE_AIHUB_NAME = $AIHUB_NAME} +${AI_SERVICES_NAME:+AZURE_AISERVICES_NAME = $AI_SERVICES_NAME} + +# Infrastructure +${ACR_NAME:+AZURE_CONTAINER_REGISTRY_NAME = $ACR_NAME} +${KEYVAULT_NAME:+AZURE_KEYVAULT_NAME = $KEYVAULT_NAME} +${STORAGE_NAME:+AZURE_STORAGE_ACCOUNT_NAME = $STORAGE_NAME} +${SEARCH_NAME:+AZURE_SEARCH_SERVICE_NAME = $SEARCH_NAME} +${APP_INSIGHTS_NAME:+AZURE_APPLICATION_INSIGHTS_NAME = $APP_INSIGHTS_NAME} +${LOG_ANALYTICS_NAME:+AZURE_LOG_ANALYTICS_WORKSPACE_NAME = $LOG_ANALYTICS_NAME} + +# Configuration Flags +USE_CONTAINER_REGISTRY = true +USE_APPLICATION_INSIGHTS = $USE_APP_INSIGHTS +USE_AZURE_AI_SEARCH_SERVICE = $USE_AI_SEARCH + +# Agent Configuration +AZURE_AI_AGENT_NAME = $AGENT_NAME +AZURE_EXISTING_AGENT_ID = $AGENT_ID +AZURE_AI_AGENT_DEPLOYMENT_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_FORMAT = OpenAI +AZURE_AI_AGENT_MODEL_VERSION = 2024-07-18 +AZURE_AI_AGENT_DEPLOYMENT_SKU = GlobalStandard +AZURE_AI_AGENT_DEPLOYMENT_CAPACITY = 80 + +# Embedding Model (if using AI Search) +AZURE_AI_EMBED_DEPLOYMENT_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_FORMAT = OpenAI +AZURE_AI_EMBED_MODEL_VERSION = 1 +AZURE_AI_EMBED_DEPLOYMENT_SKU = Standard +AZURE_AI_EMBED_DEPLOYMENT_CAPACITY = 50 + +# Existing Project +${PROJECT_RESOURCE_ID:+AZURE_EXISTING_AIPROJECT_RESOURCE_ID = $PROJECT_RESOURCE_ID} +${PROJECT_ENDPOINT:+AZURE_EXISTING_AIPROJECT_ENDPOINT = $PROJECT_ENDPOINT} +EOF + +echo "" +echo "==========================================" +echo "📄 Save this to a file for reference" +echo "==========================================" +echo "" + +# Save to file +OUTPUT_FILE="github_actions_variables.txt" +cat > "$OUTPUT_FILE" << EOF +GitHub Actions Variables for $GITHUB_ORG/$GITHUB_REPO +Generated: $(date) + +# Authentication +AZURE_CLIENT_ID = $APP_ID +AZURE_TENANT_ID = $TENANT_ID +AZURE_SUBSCRIPTION_ID = $SUBSCRIPTION_ID + +# Environment +AZURE_ENV_NAME = prod +AZURE_LOCATION = $LOCATION +AZURE_RESOURCE_GROUP = $RESOURCE_GROUP + +# AI Resources +AZURE_AIPROJECT_NAME = $AIPROJECT_NAME +${AIHUB_NAME:+AZURE_AIHUB_NAME = $AIHUB_NAME} +${AI_SERVICES_NAME:+AZURE_AISERVICES_NAME = $AI_SERVICES_NAME} + +# Infrastructure +${ACR_NAME:+AZURE_CONTAINER_REGISTRY_NAME = $ACR_NAME} +${KEYVAULT_NAME:+AZURE_KEYVAULT_NAME = $KEYVAULT_NAME} +${STORAGE_NAME:+AZURE_STORAGE_ACCOUNT_NAME = $STORAGE_NAME} +${SEARCH_NAME:+AZURE_SEARCH_SERVICE_NAME = $SEARCH_NAME} +${APP_INSIGHTS_NAME:+AZURE_APPLICATION_INSIGHTS_NAME = $APP_INSIGHTS_NAME} +${LOG_ANALYTICS_NAME:+AZURE_LOG_ANALYTICS_WORKSPACE_NAME = $LOG_ANALYTICS_NAME} + +# Configuration Flags +USE_CONTAINER_REGISTRY = true +USE_APPLICATION_INSIGHTS = $USE_APP_INSIGHTS +USE_AZURE_AI_SEARCH_SERVICE = $USE_AI_SEARCH + +# Agent Configuration +AZURE_AI_AGENT_NAME = $AGENT_NAME +AZURE_EXISTING_AGENT_ID = $AGENT_ID +AZURE_AI_AGENT_DEPLOYMENT_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_NAME = gpt-5-mini +AZURE_AI_AGENT_MODEL_FORMAT = OpenAI +AZURE_AI_AGENT_MODEL_VERSION = 2024-07-18 +AZURE_AI_AGENT_DEPLOYMENT_SKU = GlobalStandard +AZURE_AI_AGENT_DEPLOYMENT_CAPACITY = 80 + +# Embedding Model +AZURE_AI_EMBED_DEPLOYMENT_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_NAME = text-embedding-3-small +AZURE_AI_EMBED_MODEL_FORMAT = OpenAI +AZURE_AI_EMBED_MODEL_VERSION = 1 +AZURE_AI_EMBED_DEPLOYMENT_SKU = Standard +AZURE_AI_EMBED_DEPLOYMENT_CAPACITY = 50 + +# Existing Project +${PROJECT_RESOURCE_ID:+AZURE_EXISTING_AIPROJECT_RESOURCE_ID = $PROJECT_RESOURCE_ID} +${PROJECT_ENDPOINT:+AZURE_EXISTING_AIPROJECT_ENDPOINT = $PROJECT_ENDPOINT} +EOF + +echo "✅ Configuration saved to: $OUTPUT_FILE" +echo "" +echo "==========================================" +echo "🎯 Next Steps" +echo "==========================================" +echo "" +echo "1. Go to GitHub: https://github.com/$GITHUB_ORG/$GITHUB_REPO/settings/variables/actions" +echo "2. Add all the variables listed above" +echo "3. Enable GitHub Actions: https://github.com/$GITHUB_ORG/$GITHUB_REPO/actions" +echo "4. Test deployment: Go to Actions → 'Deploy to Azure' → 'Run workflow'" +echo "" +echo "✨ Setup complete!" From 21ad6b5a4257aa3c7ad9df25000ca364c1528ae8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 12:16:47 +0000 Subject: [PATCH 3/6] Add automated GitHub variables setup scripts - Added scripts/set_github_variables.sh: Bash script to set all GitHub variables via gh CLI - Added scripts/set_github_variables.ps1: PowerShell script for Windows users - Added GITHUB_VARIABLES.txt: Manual copy-paste reference for all variables These scripts configure all 31 GitHub Actions variables needed for automated deployment. Includes Azure authentication, AI resources, agent config with gpt-5-mini, and infrastructure. --- GITHUB_VARIABLES.txt | 130 +++++++++++++++++++++++++++++++ scripts/set_github_variables.ps1 | 104 +++++++++++++++++++++++++ scripts/set_github_variables.sh | 102 ++++++++++++++++++++++++ 3 files changed, 336 insertions(+) create mode 100644 GITHUB_VARIABLES.txt create mode 100644 scripts/set_github_variables.ps1 create mode 100755 scripts/set_github_variables.sh diff --git a/GITHUB_VARIABLES.txt b/GITHUB_VARIABLES.txt new file mode 100644 index 00000000..39e62a5f --- /dev/null +++ b/GITHUB_VARIABLES.txt @@ -0,0 +1,130 @@ +GitHub Actions Variables for Ksenia-personal-agent +================================================== + +COPY-PASTE THESE VALUES INTO GITHUB + +Go to: https://github.com/Skie-Art/Ksenia-personal-agent/settings/variables/actions +Click "New repository variable" for each one below: + + +=== AUTHENTICATION & ENVIRONMENT === + +Name: AZURE_CLIENT_ID +Value: db57485e-6284-434d-ba83-e8fb848cc01d + +Name: AZURE_TENANT_ID +Value: b75007f5-364a-4c13-816e-74aacedc01a5 + +Name: AZURE_SUBSCRIPTION_ID +Value: 95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6 + +Name: AZURE_ENV_NAME +Value: prod + +Name: AZURE_LOCATION +Value: eastus + +Name: AZURE_RESOURCE_GROUP +Value: rg-Ksenia-personal-agent + + +=== AI RESOURCES === + +Name: AZURE_AIPROJECT_NAME +Value: proj-fpfde4hlibpgs + +Name: AZURE_AISERVICES_NAME +Value: aoai-fpfde4hlibpgs + +Name: AZURE_AIHUB_NAME +Value: aoai-fpfde4hlibpgs + + +=== INFRASTRUCTURE === + +Name: AZURE_CONTAINER_REGISTRY_NAME +Value: crfpfde4hlibpgs + +Name: AZURE_STORAGE_ACCOUNT_NAME +Value: stfpfde4hlibpgs + + +=== CONFIGURATION FLAGS === + +Name: USE_CONTAINER_REGISTRY +Value: true + +Name: USE_APPLICATION_INSIGHTS +Value: false + +Name: USE_AZURE_AI_SEARCH_SERVICE +Value: false + + +=== AGENT CONFIGURATION (GPT-5 MINI) === + +Name: AZURE_AI_AGENT_NAME +Value: agent-template-assistant + +Name: AZURE_EXISTING_AGENT_ID +Value: asst_LwEiFvlTxOwrDx50QMTaJn2w + +Name: AZURE_AI_AGENT_DEPLOYMENT_NAME +Value: gpt-5-mini + +Name: AZURE_AI_AGENT_MODEL_NAME +Value: gpt-5-mini + +Name: AZURE_AI_AGENT_MODEL_FORMAT +Value: OpenAI + +Name: AZURE_AI_AGENT_MODEL_VERSION +Value: 2024-07-18 + +Name: AZURE_AI_AGENT_DEPLOYMENT_SKU +Value: GlobalStandard + +Name: AZURE_AI_AGENT_DEPLOYMENT_CAPACITY +Value: 80 + + +=== EMBEDDING MODEL === + +Name: AZURE_AI_EMBED_DEPLOYMENT_NAME +Value: text-embedding-3-small + +Name: AZURE_AI_EMBED_MODEL_NAME +Value: text-embedding-3-small + +Name: AZURE_AI_EMBED_MODEL_FORMAT +Value: OpenAI + +Name: AZURE_AI_EMBED_MODEL_VERSION +Value: 1 + +Name: AZURE_AI_EMBED_DEPLOYMENT_SKU +Value: Standard + +Name: AZURE_AI_EMBED_DEPLOYMENT_CAPACITY +Value: 50 + + +=== EXISTING PROJECT === + +Name: AZURE_EXISTING_AIPROJECT_RESOURCE_ID +Value: /subscriptions/95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6/resourceGroups/rg-Ksenia-personal-agent/providers/Microsoft.CognitiveServices/accounts/aoai-fpfde4hlibpgs/projects/proj-fpfde4hlibpgs + +Name: AZURE_EXISTING_AIPROJECT_ENDPOINT +Value: https://aoai-fpfde4hlibpgs.services.ai.azure.com/api/projects/proj-fpfde4hlibpgs + + +================================================== +Total: 31 variables +================================================== + +NEXT STEPS: +1. Add all variables above to GitHub (link above) +2. Enable Actions: https://github.com/Skie-Art/Ksenia-personal-agent/actions +3. Run workflow: Actions → "Deploy to Azure" → "Run workflow" + +NOTE: KeyVault not needed - the workflow will create it if necessary diff --git a/scripts/set_github_variables.ps1 b/scripts/set_github_variables.ps1 new file mode 100644 index 00000000..76c7e3f6 --- /dev/null +++ b/scripts/set_github_variables.ps1 @@ -0,0 +1,104 @@ +# PowerShell script to set GitHub Actions variables + +$ErrorActionPreference = "Stop" + +Write-Host "🚀 Setting GitHub Actions Variables" -ForegroundColor Cyan +Write-Host "====================================" -ForegroundColor Cyan +Write-Host "" + +# GitHub repository +$REPO = "Skie-Art/Ksenia-personal-agent" + +# Check if gh CLI is installed +try { + gh --version | Out-Null +} catch { + Write-Host "❌ GitHub CLI (gh) is not installed." -ForegroundColor Red + Write-Host "" + Write-Host "Install it from: https://cli.github.com/" -ForegroundColor Yellow + Write-Host "" + Write-Host "Or install via:" -ForegroundColor Yellow + Write-Host " - Windows: winget install GitHub.cli" -ForegroundColor Yellow + Write-Host "" + exit 1 +} + +# Check if authenticated +try { + gh auth status | Out-Null +} catch { + Write-Host "🔐 Not authenticated with GitHub. Logging in..." -ForegroundColor Yellow + gh auth login +} + +Write-Host "Setting variables for repository: $REPO" -ForegroundColor Green +Write-Host "" + +# Core Authentication & Environment +gh variable set AZURE_CLIENT_ID -b "db57485e-6284-434d-ba83-e8fb848cc01d" -R $REPO +gh variable set AZURE_TENANT_ID -b "b75007f5-364a-4c13-816e-74aacedc01a5" -R $REPO +gh variable set AZURE_SUBSCRIPTION_ID -b "95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6" -R $REPO +gh variable set AZURE_ENV_NAME -b "prod" -R $REPO +gh variable set AZURE_LOCATION -b "eastus" -R $REPO +gh variable set AZURE_RESOURCE_GROUP -b "rg-Ksenia-personal-agent" -R $REPO + +Write-Host "✅ Authentication & Environment variables set" -ForegroundColor Green + +# AI Resources +gh variable set AZURE_AIPROJECT_NAME -b "proj-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_AISERVICES_NAME -b "aoai-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_AIHUB_NAME -b "aoai-fpfde4hlibpgs" -R $REPO + +Write-Host "✅ AI Resources variables set" -ForegroundColor Green + +# Infrastructure +gh variable set AZURE_CONTAINER_REGISTRY_NAME -b "crfpfde4hlibpgs" -R $REPO +gh variable set AZURE_STORAGE_ACCOUNT_NAME -b "stfpfde4hlibpgs" -R $REPO + +Write-Host "✅ Infrastructure variables set" -ForegroundColor Green + +# Configuration Flags +gh variable set USE_CONTAINER_REGISTRY -b "true" -R $REPO +gh variable set USE_APPLICATION_INSIGHTS -b "false" -R $REPO +gh variable set USE_AZURE_AI_SEARCH_SERVICE -b "false" -R $REPO + +Write-Host "✅ Configuration flags set" -ForegroundColor Green + +# Agent Configuration +gh variable set AZURE_AI_AGENT_NAME -b "agent-template-assistant" -R $REPO +gh variable set AZURE_EXISTING_AGENT_ID -b "asst_LwEiFvlTxOwrDx50QMTaJn2w" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_NAME -b "gpt-5-mini" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_NAME -b "gpt-5-mini" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_FORMAT -b "OpenAI" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_VERSION -b "2024-07-18" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_SKU -b "GlobalStandard" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY -b "80" -R $REPO + +Write-Host "✅ Agent configuration set (using gpt-5-mini)" -ForegroundColor Green + +# Embedding Model +gh variable set AZURE_AI_EMBED_DEPLOYMENT_NAME -b "text-embedding-3-small" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_NAME -b "text-embedding-3-small" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_FORMAT -b "OpenAI" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_VERSION -b "1" -R $REPO +gh variable set AZURE_AI_EMBED_DEPLOYMENT_SKU -b "Standard" -R $REPO +gh variable set AZURE_AI_EMBED_DEPLOYMENT_CAPACITY -b "50" -R $REPO + +Write-Host "✅ Embedding model configuration set" -ForegroundColor Green + +# Existing Project +gh variable set AZURE_EXISTING_AIPROJECT_RESOURCE_ID -b "/subscriptions/95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6/resourceGroups/rg-Ksenia-personal-agent/providers/Microsoft.CognitiveServices/accounts/aoai-fpfde4hlibpgs/projects/proj-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_EXISTING_AIPROJECT_ENDPOINT -b "https://aoai-fpfde4hlibpgs.services.ai.azure.com/api/projects/proj-fpfde4hlibpgs" -R $REPO + +Write-Host "✅ Existing project configuration set" -ForegroundColor Green + +Write-Host "" +Write-Host "==========================================" -ForegroundColor Cyan +Write-Host "✅ All GitHub Actions variables configured!" -ForegroundColor Green +Write-Host "==========================================" -ForegroundColor Cyan +Write-Host "" +Write-Host "Next steps:" -ForegroundColor Yellow +Write-Host "1. Enable GitHub Actions: https://github.com/$REPO/actions" -ForegroundColor Yellow +Write-Host "2. Run a deployment: Actions → 'Deploy to Azure' → 'Run workflow'" -ForegroundColor Yellow +Write-Host "" +Write-Host "View all variables: https://github.com/$REPO/settings/variables/actions" -ForegroundColor Cyan diff --git a/scripts/set_github_variables.sh b/scripts/set_github_variables.sh new file mode 100755 index 00000000..e7b1b313 --- /dev/null +++ b/scripts/set_github_variables.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +set -e + +echo "🚀 Setting GitHub Actions Variables" +echo "====================================" +echo "" + +# GitHub repository +REPO="Skie-Art/Ksenia-personal-agent" + +# Check if gh CLI is installed +if ! command -v gh &> /dev/null; then + echo "❌ GitHub CLI (gh) is not installed." + echo "" + echo "Install it from: https://cli.github.com/" + echo "" + echo "Or install via:" + echo " - macOS: brew install gh" + echo " - Windows: winget install GitHub.cli" + echo " - Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md" + echo "" + exit 1 +fi + +# Check if authenticated +if ! gh auth status &> /dev/null; then + echo "🔐 Not authenticated with GitHub. Logging in..." + gh auth login +fi + +echo "Setting variables for repository: $REPO" +echo "" + +# Core Authentication & Environment +gh variable set AZURE_CLIENT_ID -b "db57485e-6284-434d-ba83-e8fb848cc01d" -R "$REPO" +gh variable set AZURE_TENANT_ID -b "b75007f5-364a-4c13-816e-74aacedc01a5" -R "$REPO" +gh variable set AZURE_SUBSCRIPTION_ID -b "95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6" -R "$REPO" +gh variable set AZURE_ENV_NAME -b "prod" -R "$REPO" +gh variable set AZURE_LOCATION -b "eastus" -R "$REPO" +gh variable set AZURE_RESOURCE_GROUP -b "rg-Ksenia-personal-agent" -R "$REPO" + +echo "✅ Authentication & Environment variables set" + +# AI Resources +gh variable set AZURE_AIPROJECT_NAME -b "proj-fpfde4hlibpgs" -R "$REPO" +gh variable set AZURE_AISERVICES_NAME -b "aoai-fpfde4hlibpgs" -R "$REPO" +gh variable set AZURE_AIHUB_NAME -b "aoai-fpfde4hlibpgs" -R "$REPO" + +echo "✅ AI Resources variables set" + +# Infrastructure +gh variable set AZURE_CONTAINER_REGISTRY_NAME -b "crfpfde4hlibpgs" -R "$REPO" +gh variable set AZURE_STORAGE_ACCOUNT_NAME -b "stfpfde4hlibpgs" -R "$REPO" + +echo "✅ Infrastructure variables set" + +# Configuration Flags +gh variable set USE_CONTAINER_REGISTRY -b "true" -R "$REPO" +gh variable set USE_APPLICATION_INSIGHTS -b "false" -R "$REPO" +gh variable set USE_AZURE_AI_SEARCH_SERVICE -b "false" -R "$REPO" + +echo "✅ Configuration flags set" + +# Agent Configuration +gh variable set AZURE_AI_AGENT_NAME -b "agent-template-assistant" -R "$REPO" +gh variable set AZURE_EXISTING_AGENT_ID -b "asst_LwEiFvlTxOwrDx50QMTaJn2w" -R "$REPO" +gh variable set AZURE_AI_AGENT_DEPLOYMENT_NAME -b "gpt-5-mini" -R "$REPO" +gh variable set AZURE_AI_AGENT_MODEL_NAME -b "gpt-5-mini" -R "$REPO" +gh variable set AZURE_AI_AGENT_MODEL_FORMAT -b "OpenAI" -R "$REPO" +gh variable set AZURE_AI_AGENT_MODEL_VERSION -b "2024-07-18" -R "$REPO" +gh variable set AZURE_AI_AGENT_DEPLOYMENT_SKU -b "GlobalStandard" -R "$REPO" +gh variable set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY -b "80" -R "$REPO" + +echo "✅ Agent configuration set (using gpt-5-mini)" + +# Embedding Model +gh variable set AZURE_AI_EMBED_DEPLOYMENT_NAME -b "text-embedding-3-small" -R "$REPO" +gh variable set AZURE_AI_EMBED_MODEL_NAME -b "text-embedding-3-small" -R "$REPO" +gh variable set AZURE_AI_EMBED_MODEL_FORMAT -b "OpenAI" -R "$REPO" +gh variable set AZURE_AI_EMBED_MODEL_VERSION -b "1" -R "$REPO" +gh variable set AZURE_AI_EMBED_DEPLOYMENT_SKU -b "Standard" -R "$REPO" +gh variable set AZURE_AI_EMBED_DEPLOYMENT_CAPACITY -b "50" -R "$REPO" + +echo "✅ Embedding model configuration set" + +# Existing Project +gh variable set AZURE_EXISTING_AIPROJECT_RESOURCE_ID -b "/subscriptions/95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6/resourceGroups/rg-Ksenia-personal-agent/providers/Microsoft.CognitiveServices/accounts/aoai-fpfde4hlibpgs/projects/proj-fpfde4hlibpgs" -R "$REPO" +gh variable set AZURE_EXISTING_AIPROJECT_ENDPOINT -b "https://aoai-fpfde4hlibpgs.services.ai.azure.com/api/projects/proj-fpfde4hlibpgs" -R "$REPO" + +echo "✅ Existing project configuration set" + +echo "" +echo "==========================================" +echo "✅ All GitHub Actions variables configured!" +echo "==========================================" +echo "" +echo "Next steps:" +echo "1. Enable GitHub Actions: https://github.com/$REPO/actions" +echo "2. Run a deployment: Actions → 'Deploy to Azure' → 'Run workflow'" +echo "" +echo "View all variables: https://github.com/$REPO/settings/variables/actions" From dea0fd3a2d6b1218793fbf04c4685e37e02a60a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 12:33:40 +0000 Subject: [PATCH 4/6] Add PowerShell script without emoji characters for compatibility --- scripts/set_github_variables_fixed.ps1 | 106 +++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 scripts/set_github_variables_fixed.ps1 diff --git a/scripts/set_github_variables_fixed.ps1 b/scripts/set_github_variables_fixed.ps1 new file mode 100644 index 00000000..97a93435 --- /dev/null +++ b/scripts/set_github_variables_fixed.ps1 @@ -0,0 +1,106 @@ +# PowerShell script to set GitHub Actions variables +# Fixed version without emojis for compatibility + +$ErrorActionPreference = "Stop" + +Write-Host "Setting GitHub Actions Variables" -ForegroundColor Cyan +Write-Host "====================================" -ForegroundColor Cyan +Write-Host "" + +# GitHub repository +$REPO = "Skie-Art/Ksenia-personal-agent" + +# Check if gh CLI is installed +try { + gh --version | Out-Null +} catch { + Write-Host "ERROR: GitHub CLI (gh) is not installed." -ForegroundColor Red + Write-Host "" + Write-Host "Install it from: https://cli.github.com/" -ForegroundColor Yellow + Write-Host "" + Write-Host "Or install via:" -ForegroundColor Yellow + Write-Host " - Windows: winget install GitHub.cli" -ForegroundColor Yellow + Write-Host "" + exit 1 +} + +# Check if authenticated +try { + gh auth status 2>&1 | Out-Null +} catch { + Write-Host "Not authenticated with GitHub. Logging in..." -ForegroundColor Yellow + gh auth login +} + +Write-Host "Setting variables for repository: $REPO" -ForegroundColor Green +Write-Host "" + +# Core Authentication & Environment +gh variable set AZURE_CLIENT_ID -b "db57485e-6284-434d-ba83-e8fb848cc01d" -R $REPO +gh variable set AZURE_TENANT_ID -b "b75007f5-364a-4c13-816e-74aacedc01a5" -R $REPO +gh variable set AZURE_SUBSCRIPTION_ID -b "95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6" -R $REPO +gh variable set AZURE_ENV_NAME -b "prod" -R $REPO +gh variable set AZURE_LOCATION -b "eastus" -R $REPO +gh variable set AZURE_RESOURCE_GROUP -b "rg-Ksenia-personal-agent" -R $REPO + +Write-Host "[OK] Authentication & Environment variables set" -ForegroundColor Green + +# AI Resources +gh variable set AZURE_AIPROJECT_NAME -b "proj-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_AISERVICES_NAME -b "aoai-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_AIHUB_NAME -b "aoai-fpfde4hlibpgs" -R $REPO + +Write-Host "[OK] AI Resources variables set" -ForegroundColor Green + +# Infrastructure +gh variable set AZURE_CONTAINER_REGISTRY_NAME -b "crfpfde4hlibpgs" -R $REPO +gh variable set AZURE_STORAGE_ACCOUNT_NAME -b "stfpfde4hlibpgs" -R $REPO + +Write-Host "[OK] Infrastructure variables set" -ForegroundColor Green + +# Configuration Flags +gh variable set USE_CONTAINER_REGISTRY -b "true" -R $REPO +gh variable set USE_APPLICATION_INSIGHTS -b "false" -R $REPO +gh variable set USE_AZURE_AI_SEARCH_SERVICE -b "false" -R $REPO + +Write-Host "[OK] Configuration flags set" -ForegroundColor Green + +# Agent Configuration +gh variable set AZURE_AI_AGENT_NAME -b "agent-template-assistant" -R $REPO +gh variable set AZURE_EXISTING_AGENT_ID -b "asst_LwEiFvlTxOwrDx50QMTaJn2w" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_NAME -b "gpt-5-mini" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_NAME -b "gpt-5-mini" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_FORMAT -b "OpenAI" -R $REPO +gh variable set AZURE_AI_AGENT_MODEL_VERSION -b "2024-07-18" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_SKU -b "GlobalStandard" -R $REPO +gh variable set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY -b "80" -R $REPO + +Write-Host "[OK] Agent configuration set (using gpt-5-mini)" -ForegroundColor Green + +# Embedding Model +gh variable set AZURE_AI_EMBED_DEPLOYMENT_NAME -b "text-embedding-3-small" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_NAME -b "text-embedding-3-small" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_FORMAT -b "OpenAI" -R $REPO +gh variable set AZURE_AI_EMBED_MODEL_VERSION -b "1" -R $REPO +gh variable set AZURE_AI_EMBED_DEPLOYMENT_SKU -b "Standard" -R $REPO +gh variable set AZURE_AI_EMBED_DEPLOYMENT_CAPACITY -b "50" -R $REPO + +Write-Host "[OK] Embedding model configuration set" -ForegroundColor Green + +# Existing Project +gh variable set AZURE_EXISTING_AIPROJECT_RESOURCE_ID -b "/subscriptions/95a864d4-ff8f-4cfa-ae93-f3b9a1ba5ae6/resourceGroups/rg-Ksenia-personal-agent/providers/Microsoft.CognitiveServices/accounts/aoai-fpfde4hlibpgs/projects/proj-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_EXISTING_AIPROJECT_ENDPOINT -b "https://aoai-fpfde4hlibpgs.services.ai.azure.com/api/projects/proj-fpfde4hlibpgs" -R $REPO + +Write-Host "[OK] Existing project configuration set" -ForegroundColor Green + +Write-Host "" +Write-Host "==========================================" -ForegroundColor Cyan +Write-Host "SUCCESS: All GitHub Actions variables configured!" -ForegroundColor Green +Write-Host "==========================================" -ForegroundColor Cyan +Write-Host "" +Write-Host "Next steps:" -ForegroundColor Yellow +Write-Host "1. Enable GitHub Actions: https://github.com/$REPO/actions" -ForegroundColor Yellow +Write-Host "2. Run a deployment: Actions -> Deploy to Azure -> Run workflow" -ForegroundColor Yellow +Write-Host "" +Write-Host "View all variables at:" -ForegroundColor Cyan +Write-Host "https://github.com/$REPO/settings/variables/actions" -ForegroundColor Cyan From 0552a44378f97476a46b3315878eccfd3765ae90 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 12:43:31 +0000 Subject: [PATCH 5/6] Add script to set missing GitHub variables --- scripts/add_missing_variables.ps1 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/add_missing_variables.ps1 diff --git a/scripts/add_missing_variables.ps1 b/scripts/add_missing_variables.ps1 new file mode 100644 index 00000000..4d7f2bc7 --- /dev/null +++ b/scripts/add_missing_variables.ps1 @@ -0,0 +1,27 @@ +# PowerShell script to add missing GitHub Actions variables + +$REPO = "Skie-Art/Ksenia-personal-agent" + +Write-Host "Adding missing variables..." -ForegroundColor Cyan + +# Application Insights (you DO have this!) +gh variable set AZURE_APPLICATION_INSIGHTS_NAME -b "appi-fpfde4hlibpgs" -R $REPO +gh variable set USE_APPLICATION_INSIGHTS -b "true" -R $REPO + +# These might exist - check your resource group, otherwise workflow will create them +gh variable set AZURE_KEYVAULT_NAME -b "kv-fpfde4hlibpgs" -R $REPO +gh variable set AZURE_LOG_ANALYTICS_WORKSPACE_NAME -b "log-fpfde4hlibpgs" -R $REPO + +# Search Service - leave empty since you're not using it +gh variable set AZURE_SEARCH_SERVICE_NAME -b "" -R $REPO + +Write-Host "[OK] Missing variables added!" -ForegroundColor Green +Write-Host "" +Write-Host "Updated:" -ForegroundColor Yellow +Write-Host " - AZURE_APPLICATION_INSIGHTS_NAME = appi-fpfde4hlibpgs" -ForegroundColor Green +Write-Host " - USE_APPLICATION_INSIGHTS = true" -ForegroundColor Green +Write-Host " - AZURE_KEYVAULT_NAME = kv-fpfde4hlibpgs" -ForegroundColor White +Write-Host " - AZURE_LOG_ANALYTICS_WORKSPACE_NAME = log-fpfde4hlibpgs" -ForegroundColor White +Write-Host " - AZURE_SEARCH_SERVICE_NAME = (empty)" -ForegroundColor White +Write-Host "" +Write-Host "Try running the deployment again!" -ForegroundColor Cyan From b3ff88f40721b55282ec502ced82f006a2bf3707 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 12:58:11 +0000 Subject: [PATCH 6/6] Fix ServicePrincipal type mismatch in deployment - Added principalType parameter to main.bicep to support ServicePrincipal deployments - Updated main.parameters.json to include principalType with ServicePrincipal default - Added PRINCIPAL_TYPE environment variable to GitHub Actions workflow - This fixes the 'UnmatchedPrincipalType' error when deploying via GitHub Actions --- .github/workflows/azure-dev.yml | 1 + infra/main.bicep | 6 +++++- infra/main.parameters.json | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-dev.yml b/.github/workflows/azure-dev.yml index 4957d802..c5587080 100644 --- a/.github/workflows/azure-dev.yml +++ b/.github/workflows/azure-dev.yml @@ -53,6 +53,7 @@ jobs: AZURE_AI_EMBED_MODEL_FORMAT: ${{ vars.AZURE_AI_EMBED_MODEL_FORMAT }} AZURE_AI_EMBED_MODEL_VERSION: ${{ vars.AZURE_AI_EMBED_MODEL_VERSION }} AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ vars.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }} + PRINCIPAL_TYPE: ServicePrincipal steps: - name: Checkout uses: actions/checkout@v4 diff --git a/infra/main.bicep b/infra/main.bicep index 62525bc3..fe0f7a63 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -116,10 +116,14 @@ param azureTracingGenAIContentRecordingEnabled bool = false param templateValidationMode bool = false +@description('Principal type for the deployment runner (User or ServicePrincipal)') +@allowed(['User', 'ServicePrincipal']) +param principalType string = 'User' + @description('Random seed to be used during generation of new resources suffixes.') param seed string = newGuid() -var runnerPrincipalType = templateValidationMode? 'ServicePrincipal' : 'User' +var runnerPrincipalType = templateValidationMode ? 'ServicePrincipal' : principalType var abbrs = loadJsonContent('./abbreviations.json') diff --git a/infra/main.parameters.json b/infra/main.parameters.json index 41d779bf..3907585d 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -115,6 +115,9 @@ }, "templateValidationMode": { "value": "${TEMPLATE_VALIDATION_MODE=false}" + }, + "principalType": { + "value": "${PRINCIPAL_TYPE=ServicePrincipal}" } } }