Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
746b796
Upgrade azure-ai-projects to 2.1.0 and agent-framework to 1.3.0
Prachig-Microsoft May 20, 2026
c234316
fix: update agent_framework.azure imports to agent_framework.openai f…
Prachig-Microsoft May 20, 2026
e73f9f4
fix: replace removed event classes with WorkflowEvent type checks
Prachig-Microsoft May 20, 2026
77f0171
revert: change agent-framework to 1.1.1, revert all 1.3.0 code changes
Prachig-Microsoft May 20, 2026
4e87965
fix: apply breaking-change fixes for agent-framework 1.1.1
Prachig-Microsoft May 20, 2026
ee4650a
fix: regenerate uv.lock files for agent-framework 1.1.1
Prachig-Microsoft May 21, 2026
1b14417
fix: update test patches to use new agent_framework.openai classes
Prachig-Microsoft May 21, 2026
b400522
fix: migrate all renamed agent-framework symbols for 1.1.1
Prachig-Microsoft May 21, 2026
1e66f9e
fix: update docstring example to use Agent() constructor pattern
Prachig-Microsoft May 21, 2026
803fc11
fix: pass start_executor to WorkflowBuilder constructor
Prachig-Microsoft May 21, 2026
1927aa0
fix: use executor instances in WorkflowBuilder (1.1.1 API)
Prachig-Microsoft May 21, 2026
793f1b3
fix: align all code with agent-framework 1.1.1 API
Prachig-Microsoft May 21, 2026
369e3f7
fix: Workflow.run_stream() -> run(stream=True) in 1.1.1
Prachig-Microsoft May 21, 2026
9c23281
fix: remove await from sync ctx.set_state() and fix Role enum usage
Prachig-Microsoft May 21, 2026
ce961ad
chore: revert irrelevant docstring/comment changes from upgrade
Prachig-Microsoft May 21, 2026
f7c4134
fix: remove unused imports and trailing blank line (lint fixes)
Prachig-Microsoft May 22, 2026
8255859
Merge branch 'dev' into feature/upgrade-azure-ai-libs
Prachig-Microsoft May 22, 2026
13fe76a
fix: replace invalid 'reasoning' dict with 'reasoning_effort' string …
Prachig-Microsoft May 22, 2026
96df974
fix: replace Role.USER with 'user' string in test_input_observer_midd…
Prachig-Microsoft May 22, 2026
5eefab5
Merge branch 'feature/upgrade-azure-ai-libs' into feature/upgrade-azu…
Prachig-Microsoft May 27, 2026
5022e34
chore: upgrade agent-framework from 1.1.1 to 1.3.0
Prachig-Microsoft May 27, 2026
f934b45
fix: strip temperature/top_p for reasoning models in AgentBuilder
Prachig-Microsoft May 27, 2026
83e189a
fix: skip logprobs for reasoning models in map_handler
Prachig-Microsoft May 27, 2026
0b7c3f7
refactor: promote _is_reasoning_model and _resolve_model_name to publ…
Prachig-Microsoft Jun 4, 2026
320a6b3
fix: pass Message as positional arg to Agent.run()
Prachig-Microsoft Jun 4, 2026
45dd822
fix: Upgrade azure-ai-projects and agent-framework
Avijit-Microsoft Jun 4, 2026
23d768c
fix(post-deploy): harden Content Understanding refresh against stale …
Shubhangi-Microsoft Jun 9, 2026
1e1fc41
chore(infra): regenerate main.json with bicep 0.43.8 (no semantic cha…
Shubhangi-Microsoft Jun 9, 2026
f67f5f7
fix(post-deploy): refuse to guess when multiple AIServices accounts e…
Shubhangi-Microsoft Jun 9, 2026
0b5d1a7
fix(post-deploy): preserve stderr so transient CLI errors don't masqu…
Shubhangi-Microsoft Jun 9, 2026
fea3ac8
Merge pull request #615 from microsoft/psl-bug46192
Roopan-Microsoft Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "5885652317352749587"
"version": "0.43.8.12551",
"templateHash": "12545195410241248179"
},
"name": "Content Processing Solution Accelerator",
"description": "Bicep template to deploy the Content Processing Solution Accelerator with AVM compliance."
Expand Down Expand Up @@ -337,8 +337,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "10219602196309243204"
"version": "0.43.8.12551",
"templateHash": "13206959925771644022"
}
},
"definitions": {
Expand Down Expand Up @@ -19306,8 +19306,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "15098611015028470375"
"version": "0.43.8.12551",
"templateHash": "13200482898648544945"
}
},
"parameters": {
Expand Down Expand Up @@ -23332,8 +23332,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "18123481228095028530"
"version": "0.43.8.12551",
"templateHash": "15729887991536611208"
}
},
"parameters": {
Expand Down Expand Up @@ -23936,8 +23936,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "1869938830611166930"
"version": "0.43.8.12551",
"templateHash": "8672669912945312056"
},
"name": "Container Registry Module"
},
Expand Down Expand Up @@ -36183,8 +36183,8 @@
"avmContainerApp_API",
"avmContainerApp_Workflow",
"avmManagedIdentity",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
"virtualNetwork"
]
},
Expand Down Expand Up @@ -36314,8 +36314,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "18336251851332975005"
"version": "0.43.8.12551",
"templateHash": "9621562991003135575"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service."
Expand Down Expand Up @@ -37574,8 +37574,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "8883353547455396972"
"version": "0.43.8.12551",
"templateHash": "8864856500234357706"
}
},
"definitions": {
Expand Down Expand Up @@ -39307,8 +39307,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "13560950051680758953"
"version": "0.43.8.12551",
"templateHash": "312284397710022090"
}
},
"definitions": {
Expand Down Expand Up @@ -39461,8 +39461,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "2020223351407601593"
"version": "0.43.8.12551",
"templateHash": "276675105610077046"
}
},
"definitions": {
Expand Down Expand Up @@ -39679,8 +39679,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "8883353547455396972"
"version": "0.43.8.12551",
"templateHash": "8864856500234357706"
}
},
"definitions": {
Expand Down Expand Up @@ -41412,8 +41412,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "13560950051680758953"
"version": "0.43.8.12551",
"templateHash": "312284397710022090"
}
},
"definitions": {
Expand Down Expand Up @@ -41566,8 +41566,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.42.1.51946",
"templateHash": "2020223351407601593"
"version": "0.43.8.12551",
"templateHash": "276675105610077046"
}
},
"definitions": {
Expand Down Expand Up @@ -42487,9 +42487,9 @@
},
"dependsOn": [
"avmAiServices",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').contentUnderstanding)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
"virtualNetwork"
]
Expand Down
71 changes: 71 additions & 0 deletions infra/scripts/post_deployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,74 @@ if (-not $ApiReady) {
Write-Host " Schemas registered: $($Registered.Count)"
Write-Host ("=" * 60)
}

# --- Refresh Content Understanding Cognitive Services account ---
Write-Host ""
Write-Host ("=" * 60)
Write-Host "Refreshing Content Understanding Cognitive Services account..."
Write-Host ("=" * 60)

$CU_ACCOUNT_NAME = ""
try {
$CU_ACCOUNT_NAME = (azd env get-value CONTENT_UNDERSTANDING_ACCOUNT_NAME 2>$null)
if (-not $CU_ACCOUNT_NAME) { $CU_ACCOUNT_NAME = "" }
} catch {
$CU_ACCOUNT_NAME = ""
}

# Verify the account from the env value still exists; if not, fall back to discovering
# the AIServices account in the resource group. This protects against stale .env values
# left over from prior deployments (different template/fork) and against the env value
# pointing to a resource that no longer exists.
if ($CU_ACCOUNT_NAME) {
# Capture stderr so we can distinguish a real "not found" response from a
# transient/auth/CLI failure. Only treat the env value as stale when Azure
# actually reports the resource is missing; for any other error keep the
# env value untouched and log the underlying error for diagnosability.
$ShowOutput = az cognitiveservices account show -g $RESOURCE_GROUP -n $CU_ACCOUNT_NAME --output none 2>&1
if ($LASTEXITCODE -ne 0) {
$ShowOutputStr = ($ShowOutput | Out-String).Trim()
if ($ShowOutputStr -match '(?i)ResourceNotFound|was not found|could not be found') {
Write-Host " [Warn] Cognitive Services account '$CU_ACCOUNT_NAME' from azd env was not found in resource group '$RESOURCE_GROUP'."
Write-Host " The azd env value may be stale. Attempting to discover the AIServices account in the resource group..."
$CU_ACCOUNT_NAME = ""
} else {
Write-Host " [Warn] Could not verify Cognitive Services account '$CU_ACCOUNT_NAME' (transient or CLI error). Keeping env value and skipping discovery."
Write-Host " az error: $ShowOutputStr"
}
}
}

if (-not $CU_ACCOUNT_NAME) {
# Enumerate ALL AIServices accounts (not just the first). When the resource
# group contains exactly one we auto-recover; when it contains more than one
# we refuse to guess and ask the user to set the env value explicitly, to
# avoid persisting the wrong account name into azd env.
$CuAccounts = @(az cognitiveservices account list -g $RESOURCE_GROUP --query "[?kind=='AIServices'].name" -o tsv 2>$null)
$CuAccounts = @($CuAccounts | Where-Object { $_ -and $_.Trim() -ne "" })
if ($CuAccounts.Count -eq 1) {
$CU_ACCOUNT_NAME = $CuAccounts[0]
Write-Host " Discovered AIServices account in resource group: $CU_ACCOUNT_NAME"
# Refresh the azd env so subsequent runs use the correct value.
try { azd env set CONTENT_UNDERSTANDING_ACCOUNT_NAME $CU_ACCOUNT_NAME 2>$null | Out-Null } catch { }
} elseif ($CuAccounts.Count -gt 1) {
Write-Host " [Warn] Multiple AIServices accounts found in resource group '$RESOURCE_GROUP': $($CuAccounts -join ', ')"
Write-Host " Please set CONTENT_UNDERSTANDING_ACCOUNT_NAME in azd env to the correct account name. Skipping refresh."
} else {
Write-Host " [Warn] No Content Understanding (AIServices) account found in resource group '$RESOURCE_GROUP'. Skipping refresh."
}
}

if ($CU_ACCOUNT_NAME) {
Write-Host " Refreshing account: $CU_ACCOUNT_NAME in resource group: $RESOURCE_GROUP"
# Capture stderr so that any Azure CLI error is preserved in deployment
# logs even though this refresh step is non-fatal.
$UpdateOutput = az cognitiveservices account update -g $RESOURCE_GROUP -n $CU_ACCOUNT_NAME --tags refresh=true --output none 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [OK] Successfully refreshed Cognitive Services account '$CU_ACCOUNT_NAME'."
} else {
$UpdateOutputStr = ($UpdateOutput | Out-String).Trim()
Write-Host " [Warn] Could not refresh Cognitive Services account '$CU_ACCOUNT_NAME'. Continuing - this step is non-fatal."
Write-Host " az error: $UpdateOutputStr"
}
}
77 changes: 72 additions & 5 deletions infra/scripts/post_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,84 @@ echo "============================================================"

CU_ACCOUNT_NAME=$(azd env get-value CONTENT_UNDERSTANDING_ACCOUNT_NAME 2>/dev/null || echo "")

# Verify the account from the env value still exists; if not, fall back to discovering
# the AIServices account in the resource group. This protects against stale .env values
# left over from prior deployments (different template/fork) and against the env value
# pointing to a resource that no longer exists.
if [ -n "$CU_ACCOUNT_NAME" ]; then
# Capture stderr so we can distinguish a real "not found" response from a
# transient/auth/CLI failure. Only treat the env value as stale when Azure
# actually reports the resource is missing; for any other error keep the
# env value untouched and log the underlying error for diagnosability.
# `set +e` is required because `set -e` (enabled at the top of the script)
# would otherwise exit the script as soon as `az ... show` returns non-zero,
# before we can inspect $? and decide whether to fall back to discovery.
set +e
CU_SHOW_ERR=$(az cognitiveservices account show \
-g "$RESOURCE_GROUP" \
-n "$CU_ACCOUNT_NAME" \
--output none 2>&1)
CU_SHOW_EC=$?
set -e
if [ $CU_SHOW_EC -ne 0 ]; then
if echo "$CU_SHOW_ERR" | grep -qiE "ResourceNotFound|was not found|could not be found"; then
echo " ⚠️ Cognitive Services account '$CU_ACCOUNT_NAME' from azd env was not found in resource group '$RESOURCE_GROUP'."
echo " The azd env value may be stale. Attempting to discover the AIServices account in the resource group..."
CU_ACCOUNT_NAME=""
else
echo " ⚠️ Could not verify Cognitive Services account '$CU_ACCOUNT_NAME' (transient or CLI error). Keeping env value and skipping discovery."
echo " az error: $CU_SHOW_ERR"
fi
fi
fi

if [ -z "$CU_ACCOUNT_NAME" ]; then
echo " ⚠️ CONTENT_UNDERSTANDING_ACCOUNT_NAME not found in azd env. Skipping refresh."
else
# Enumerate ALL AIServices accounts (not just the first). When the resource
# group contains exactly one we auto-recover; when it contains more than one
# we refuse to guess and ask the user to set the env value explicitly, to
# avoid persisting the wrong account name into azd env.
# Use a portable `while read` loop instead of `mapfile`, because `mapfile`
# requires bash 4+ and the azd postprovision hook also runs on macOS where
# the default shell is still bash 3.2.
CU_ACCOUNTS=()
while IFS= read -r _cu_acct; do
[ -n "$_cu_acct" ] && CU_ACCOUNTS+=("$_cu_acct")
done < <(az cognitiveservices account list \
-g "$RESOURCE_GROUP" \
--query "[?kind=='AIServices'].name" \
-o tsv 2>/dev/null || true)
if [ "${#CU_ACCOUNTS[@]}" -eq 1 ]; then
CU_ACCOUNT_NAME="${CU_ACCOUNTS[0]}"
echo " Discovered AIServices account in resource group: $CU_ACCOUNT_NAME"
# Refresh the azd env so subsequent runs use the correct value.
azd env set CONTENT_UNDERSTANDING_ACCOUNT_NAME "$CU_ACCOUNT_NAME" >/dev/null 2>&1 || true
elif [ "${#CU_ACCOUNTS[@]}" -gt 1 ]; then
echo " ⚠️ Multiple AIServices accounts found in resource group '$RESOURCE_GROUP': ${CU_ACCOUNTS[*]}"
echo " Please set CONTENT_UNDERSTANDING_ACCOUNT_NAME in azd env to the correct account name. Skipping refresh."
else
echo " ⚠️ No Content Understanding (AIServices) account found in resource group '$RESOURCE_GROUP'. Skipping refresh."
fi
fi

if [ -n "$CU_ACCOUNT_NAME" ]; then
echo " Refreshing account: $CU_ACCOUNT_NAME in resource group: $RESOURCE_GROUP"
if az cognitiveservices account update \
# Capture stderr so that any Azure CLI error is preserved in deployment
# logs even though this refresh step is non-fatal.
# `set +e` is required because `set -e` (enabled at the top of the script)
# would otherwise exit the script as soon as `az ... update` returns
# non-zero, defeating the explicit "non-fatal" handling below.
set +e
CU_UPDATE_ERR=$(az cognitiveservices account update \
-g "$RESOURCE_GROUP" \
-n "$CU_ACCOUNT_NAME" \
--tags refresh=true \
--output none; then
--output none 2>&1)
CU_UPDATE_EC=$?
set -e
if [ $CU_UPDATE_EC -eq 0 ]; then
echo " ✅ Successfully refreshed Cognitive Services account '$CU_ACCOUNT_NAME'."
else
echo " ❌ Failed to refresh Cognitive Services account '$CU_ACCOUNT_NAME'."
echo " ⚠️ Could not refresh Cognitive Services account '$CU_ACCOUNT_NAME'. Continuing — this step is non-fatal."
echo " az error: $CU_UPDATE_ERR"
fi
fi
19 changes: 13 additions & 6 deletions infra/vscode_web/codeSample.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
from azure.ai.agents.models import ListSortOrder

project_client = AIProjectClient.from_connection_string(
credential=DefaultAzureCredential(),
conn_str="<%= connectionString %>")

agent = project_client.agents.get_agent("<%= agentId %>")

thread = project_client.agents.create_thread()
thread = project_client.agents.threads.create()
print(f"Created thread, ID: {thread.id}")

message = project_client.agents.create_message(
message = project_client.agents.messages.create(
thread_id=thread.id,
role="user",
content="<%= userMessage %>"
)

run = project_client.agents.create_and_process_run(
run = project_client.agents.runs.create_and_process(
thread_id=thread.id,
agent_id=agent.id)
messages = project_client.agents.list_messages(thread_id=thread.id)

for text_message in messages.text_messages:
print(text_message.as_dict())
if run.status == "failed":
print(f"Run failed: {run.last_error}")
else:
messages = project_client.agents.messages.list(
thread_id=thread.id, order=ListSortOrder.ASCENDING)

for message in messages:
if message.text_messages:
print(f"{message.role}: {message.text_messages[-1].text.value}")
2 changes: 1 addition & 1 deletion infra/vscode_web/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
azure-ai-projects==1.0.0b12
azure-ai-projects==2.1.0
azure-identity==1.20.0
ansible-core~=2.17.0
2 changes: 1 addition & 1 deletion src/ContentProcessor/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Content Process Gold Standard Solution Accelerator - Content Proc
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"agent-framework==1.0.0b260127",
"agent-framework==1.3.0",
"azure-ai-inference==1.0.0b9",
"azure-appconfiguration==1.8.0",
"azure-identity==1.26.0b1",
Expand Down
Loading
Loading