Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
287c718
azure-ai-search-index-backup-restore - Added new azure ai search inde…
chadpalmer Mar 16, 2026
368ea98
Merge branch 'feedback-user-timeout' into azure-ai-search-index-backu…
chadpalmer Mar 19, 2026
aace98e
azure-ai-search-index-backup-restore - Added Azure connection option …
chadpalmer Mar 23, 2026
2d71528
azure-ai-search-index-backup-restore - Fixed merge conflict.
chadpalmer Mar 25, 2026
33eac4d
azure-ai-search-index-backup-restore - Added direct to blob storage a…
chadpalmer Mar 27, 2026
c5b157c
azure-ai-search-index-backup-restore - Fixed merge conflict.
chadpalmer Apr 3, 2026
db32725
azure-ai-search-index-backup-restore - Updated restore script to add …
chadpalmer Apr 6, 2026
9d396aa
azure-ai-search-index-backup-restore - Fixed merge conflict.
chadpalmer Apr 7, 2026
cfae295
azure-ai-search-index-backup-restore - Added automated script set up …
chadpalmer Apr 7, 2026
2c14763
azure-ai-search-index-backup-restore - Fixed merge conflict.
chadpalmer Apr 14, 2026
9b21407
azure-ai-search-index-backup-restore - Added setup scripts.
chadpalmer Apr 15, 2026
49a8dff
azure-ai-search-index-backup-restore - Updated script to run correctly.
chadpalmer Apr 15, 2026
0fcf8bd
azure-ai-search-index-backup-restore - steup scripts now working.
chadpalmer Apr 16, 2026
029b830
foundry-managed-identity - stashing updates for foundry.
chadpalmer Apr 22, 2026
c5680ea
foundry-managed-identity - Updated release notes.
chadpalmer Apr 22, 2026
ab81176
foundry-managed-identity - Updated more Foundry endpoint code.
chadpalmer May 1, 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
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.241.006"
VERSION = "0.241.038"

SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')

Expand Down
21 changes: 13 additions & 8 deletions application/single_app/foundry_agent_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
AzureAuthorityHosts,
ClientSecretCredential as SyncClientSecretCredential,
DefaultAzureCredential as SyncDefaultAzureCredential,
ManagedIdentityCredential as SyncManagedIdentityCredential,
)
from azure.identity.aio import ( # type: ignore
ClientSecretCredential as AsyncClientSecretCredential,
DefaultAzureCredential as AsyncDefaultAzureCredential,
ManagedIdentityCredential as AsyncManagedIdentityCredential,
)
from semantic_kernel.agents import AzureAIAgent
from semantic_kernel.contents.chat_message_content import ChatMessageContent
Expand Down Expand Up @@ -625,11 +627,8 @@ def _build_async_credential(

if auth_type == "managed_identity":
if managed_identity_type == "user_assigned" and managed_identity_client_id:
return AsyncDefaultAzureCredential(
authority=authority,
managed_identity_client_id=managed_identity_client_id,
)
return AsyncDefaultAzureCredential(authority=authority)
return AsyncManagedIdentityCredential(client_id=managed_identity_client_id)
return AsyncManagedIdentityCredential()

# Fall back to default chained credentials (managed identity, CLI, etc.)
return AsyncDefaultAzureCredential(authority=authority)
Expand Down Expand Up @@ -1300,8 +1299,9 @@ def resolve_foundry_project_api_version(api_version):
return "v1"

def resolve_authority(auth_settings):

management_cloud = (auth_settings.get("management_cloud") or "public").lower()
if management_cloud == "government":
if management_cloud in ("government", "usgovernment", "usgov", "gcc"):
return "https://login.microsoftonline.us"
if management_cloud == "custom":
custom_authority = auth_settings.get("custom_authority") or ""
Expand All @@ -1322,8 +1322,13 @@ def build_project_credential(auth_settings):
)
if auth_type == "api_key":
raise ValueError("API key auth is not supported for Foundry project discovery.")
managed_identity_client_id = auth_settings.get("managed_identity_client_id") or None
return SyncDefaultAzureCredential(managed_identity_client_id=managed_identity_client_id)
managed_identity_type = str(auth_settings.get("managed_identity_type") or "system_assigned").lower()
managed_identity_client_id = None
if managed_identity_type == "user_assigned":
managed_identity_client_id = str(auth_settings.get("managed_identity_client_id") or "").strip() or None
if not managed_identity_client_id:
raise ValueError("Managed identity client ID is required for user-assigned managed identity.")
return SyncManagedIdentityCredential(client_id=managed_identity_client_id)

def list_new_foundry_agents_from_project(endpoint_cfg):
connection = endpoint_cfg.get("connection", {}) or {}
Expand Down
16 changes: 12 additions & 4 deletions application/single_app/route_backend_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from functions_activity_logging import log_chat_activity, log_conversation_creation, log_token_usage
from flask import current_app
from swagger_wrapper import swagger_route, get_auth_security
from azure.identity import ClientSecretCredential, DefaultAzureCredential, get_bearer_token_provider
from azure.identity import ClientSecretCredential, DefaultAzureCredential, ManagedIdentityCredential, get_bearer_token_provider
from functions_keyvault import SecretReturnType, keyvault_model_endpoint_get_helper
from functions_message_artifacts import (
build_agent_citation_artifact_documents,
Expand Down Expand Up @@ -5481,6 +5481,10 @@ async def run_tabular_analysis_with_multi_file_support(user_question, tabular_fi
def resolve_foundry_scope_for_auth(auth_settings, endpoint=None):
"""Resolve the correct scope for Foundry-backed inference authentication."""
auth_settings = auth_settings or {}
endpoint_value = str(endpoint or '').lower()
if '.openai.' in endpoint_value:
return cognitive_services_scope

custom_scope = str(auth_settings.get('foundry_scope') or '').strip()
if custom_scope:
return custom_scope
Expand All @@ -5493,7 +5497,6 @@ def resolve_foundry_scope_for_auth(auth_settings, endpoint=None):
if management_cloud == 'germany':
return 'https://ai.azure.de/.default'

endpoint_value = str(endpoint or '').lower()
if 'azure.us' in endpoint_value:
return 'https://ai.azure.us/.default'
if 'azure.cn' in endpoint_value:
Expand Down Expand Up @@ -5551,8 +5554,13 @@ def build_streaming_multi_endpoint_client(auth_settings, provider, endpoint, api
authority=resolve_authority(auth_settings),
)
else:
managed_identity_client_id = auth_settings.get('managed_identity_client_id') or None
credential = DefaultAzureCredential(managed_identity_client_id=managed_identity_client_id)
managed_identity_type = str(auth_settings.get('managed_identity_type') or 'system_assigned').lower()
managed_identity_client_id = None
if managed_identity_type == 'user_assigned':
managed_identity_client_id = str(auth_settings.get('managed_identity_client_id') or '').strip() or None
if not managed_identity_client_id:
raise ValueError('Selected model endpoint is configured for user-assigned managed identity but no client ID is set.')
credential = ManagedIdentityCredential(client_id=managed_identity_client_id)

scope = cognitive_services_scope
if normalized_provider in ('aifoundry', 'new_foundry'):
Expand Down
Loading
Loading