Skip to content

Commit 37a9482

Browse files
foundry-samples-repo-sync[bot]nikhowlettMicrosoftaahill
authored
Automated sync from private repo (2026-03-19) (#608)
* initial commit (#83) * updating C# code (#90) * Update sync state to 560fc8afc9b5 --------- Co-authored-by: nikhowlettMicrosoft <97988752+nikhowlettMicrosoft@users.noreply.github.com> Co-authored-by: aahill <aahi@microsoft.com> Co-authored-by: foundry-samples-repo-sync[bot] <foundry-samples-repo-sync[bot]@users.noreply.github.com>
1 parent 36390f8 commit 37a9482

6 files changed

Lines changed: 78 additions & 5 deletions

File tree

.github/.sync-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f65b829bf46c52559a5775ac112b2c216293ffdb
1+
560fc8afc9b55c70a8dd25d7b55335a4426fddef

migration/setup-azure-auth.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
# Azure CLI Authentication Helper for Docker Container
3+
# This script helps set up Azure CLI authentication for the migration container
4+
5+
set -e
6+
7+
# Colors for output
8+
RED='\033[0;31m'
9+
GREEN='\033[0;32m'
10+
YELLOW='\033[1;33m'
11+
BLUE='\033[0;34m'
12+
NC='\033[0m' # No Color
13+
14+
echo -e "${BLUE}🔐 Azure CLI Authentication Setup for Docker Container${NC}"
15+
echo "========================================================"
16+
17+
# Check if Docker is running
18+
if ! docker info > /dev/null 2>&1; then
19+
echo -e "${RED}❌ Docker is not running. Please start Docker and try again.${NC}"
20+
exit 1
21+
fi
22+
23+
# Check if Azure CLI is installed
24+
if ! command -v az &> /dev/null; then
25+
echo -e "${RED}❌ Azure CLI is not installed on the host system.${NC}"
26+
echo -e "${YELLOW}💡 Install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli${NC}"
27+
exit 1
28+
else
29+
echo -e "${GREEN}✅ Azure CLI is installed on host${NC}"
30+
fi
31+
32+
# Check if already authenticated
33+
if az account show > /dev/null 2>&1; then
34+
echo -e "${GREEN}✅ Already authenticated to Azure CLI${NC}"
35+
echo ""
36+
echo -e "${BLUE}📋 Current account info:${NC}"
37+
az account show --output table
38+
else
39+
echo -e "${YELLOW}⚠️ Not authenticated to Azure CLI${NC}"
40+
echo -e "${BLUE}🔑 Starting Azure CLI login process...${NC}"
41+
echo ""
42+
az login
43+
44+
if [ $? -eq 0 ]; then
45+
echo -e "${GREEN}✅ Successfully authenticated to Azure CLI${NC}"
46+
echo ""
47+
echo -e "${BLUE}📋 Current account info:${NC}"
48+
az account show --output table
49+
else
50+
echo -e "${RED}❌ Azure CLI login failed${NC}"
51+
exit 1
52+
fi
53+
fi
54+
55+
echo ""
56+
echo -e "${BLUE}🔨 Building Docker image with Azure CLI support...${NC}"
57+
docker build -t v1-to-v2-migration .
58+
59+
echo ""
60+
echo -e "${BLUE}🧪 Testing Azure CLI authentication in container...${NC}"
61+
docker run --rm -it \
62+
--network host \
63+
-v ~/.azure:/home/migration/.azure \
64+
v1-to-v2-migration \
65+
/bin/bash -c "az account show --output table || echo 'Authentication test failed'"
66+
67+
echo ""
68+
echo -e "${GREEN}✅ Setup complete! You can now run migration commands.${NC}"
69+
echo ""
70+
echo -e "${YELLOW}📋 Example commands:${NC}"
71+
echo -e "${NC} ./run-migration.sh --help${NC}"
72+
echo -e "${NC} ./run-migration.sh --project-endpoint \"https://your-endpoint\" --use-v2-api your-assistant-id${NC}"
73+
echo -e "${NC} ./run-migration.sh --project-connection-string \"your-connection-string\" --use-v2-api your-assistant-id${NC}"
74+
echo ""

migration/v1_to_v2_migration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os, sys, time, json, argparse, subprocess, requests
22
from typing import List, Dict, Any, Optional
33
from azure.cosmos import CosmosClient, exceptions
4-
from read_cosmos_data import fetch_data
54
from azure.ai.agents.models import AzureFunctionStorageQueue, AzureFunctionTool
65

76
# Import AIProjectClient for project endpoint support

samples/csharp/quickstart/chat-with-agent/quickstart-chat-with-agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Azure.Identity;
22
using Azure.AI.Projects;
3-
using Azure.AI.Projects.OpenAI;
3+
using Azure.AI.Extensions.OpenAI;
44
using OpenAI.Responses;
55

66
#pragma warning disable OPENAI001

samples/csharp/quickstart/create-agent/quickstart-create-agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Azure.Identity;
22
using Azure.AI.Projects;
3-
using Azure.AI.Projects.OpenAI;
3+
using Azure.AI.Extensions.OpenAI;
44

55
// Format: "https://resource_name.ai.azure.com/api/projects/project_name"
66
var ProjectEndpoint = "your_project_endpoint";

samples/csharp/quickstart/responses/quickstart-responses.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Azure.Identity;
22
using Azure.AI.Projects;
3-
using Azure.AI.Projects.OpenAI;
3+
using Azure.AI.Extensions.OpenAI;
44
using OpenAI.Responses;
55

66
#pragma warning disable OPENAI001

0 commit comments

Comments
 (0)