Azure AI Assistant freezes during file operations and processing tasks

Issue Description

I’m working with Azure AI Agent Service following the Microsoft documentation tutorial. Everything runs fine for basic text responses, but I encounter a blocking issue when requesting file operations.

Code Example

Here’s my current implementation:

thread_run = client_service.agents.create_and_process_run(
    thread_id=conversation.id, 
    assistant_id=assistant.id
)

print(f"Execution status: {thread_run.status}")
print(f"Details: {thread_run}")

Problem Details

The agent works perfectly for simple requests like “Tell me a story”. However, when I modify the request to “Tell me a story and save it to story.txt”, the process gets stuck in RunStatus.IN_PROGRESS state for exactly 10 minutes before timing out with expired status.

I’ve tested this with multiple models including gpt-4o-mini and gpt-4o in different regions. The same freezing behavior occurs with file upload operations as well.

Environment Setup

Using Python 3.12.8 with azure-ai-projects 1.0.0b4 and all dependencies up to date.

Has anyone encountered similar timeout issues when working with file generation or upload features in Azure AI Assistant? Any suggestions for troubleshooting this blocking behavior would be appreciated.

Hit this same issue last month building a document processing agent. Azure AI Assistant chokes on concurrent file writes during the same run - it just can’t handle it well. Here’s what fixed it for me: split your workflow. Don’t ask for story generation and file saving in one go. Get the story content first, then handle file operations through a separate API call outside the assistant. That 10-minute timeout? That’s the default run timeout, and there’s no clean way to extend it for file ops. Also check your resource quotas in Azure portal - turned out my subscription had tight limits on file operations that weren’t obvious from the error messages.

I encountered a similar challenge while developing a report generation tool with Azure AI Assistant. The default execution timeouts can lead to issues during file operations. My solution was to implement polling instead of waiting for the run to complete. Initiate the run and then check its status every 30 seconds using client_service.agents.get_run(). If you notice it’s stuck in IN_PROGRESS for more than 2-3 minutes during file operations, I recommend canceling it and retrying with a more straightforward prompt. Additionally, providing specific file format and size constraints in your initial system message can help optimize Azure’s resource allocation for file operations.

Hit this same bug a few weeks back. Azure AI Assistant file tools are broken in the current beta. Downgrade to azure-ai-projects 1.0.0b3 - that version actually handles file operations. The b4 release has a regression that makes file writes hang forever. Also double-check that your assistant has file_search enabled in Azure portal config, not just code_interpreter.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.