AI Assistant freezes when creating or uploading files in Azure AI Agent Service

I’m having trouble with the Azure AI Agent Service. Everything works fine when I just ask the AI to do simple tasks. But when I try to make it create a file or upload one, it gets stuck.

Here’s what happens:

  1. I run the agent like normal
  2. When it gets to the part where it’s supposed to process the run, it just sits there
  3. After exactly 10 minutes, it says the run expired

I’ve tried different AI models and locations, but I get the same problem. It’s weird because if I ask it to “Generate a joke”, it works great. But if I say “Generate a joke and save it to a file”, it freezes up.

I’m using Python 3.12.8 and the latest version of azure-ai-projects (1.0.0b4). Has anyone else run into this? Any ideas on how to fix it?

Here’s a simple code example of what’s not working:

from azure.ai.projects import ProjectsClient

client = ProjectsClient(endpoint, key)

agent = client.agents.create(name="FileWriter", description="Writes files")
thread = client.threads.create()

run = client.agents.create_and_process_run(
    thread_id=thread.id,
    assistant_id=agent.id,
    messages=[{"role": "user", "content": "Write 'Hello World' to a file named greeting.txt"}]
)

print(f"Run status: {run.status}")

This just hangs for 10 minutes before failing. Any help would be awesome!

I’ve encountered a similar issue with the Azure AI Agent Service when working on file operations. From my experience, this could be related to permissions or configuration settings within your Azure environment.

Have you checked if your service principal or managed identity has the necessary permissions to create and manipulate files in the designated storage location? Sometimes, the AI service has general operation permissions but lacks specific write access.

Another potential cause could be network constraints or firewall rules blocking outbound connections from the AI service to the storage endpoint. It might be worth reviewing your network security groups and firewall settings.

Lastly, I’d recommend checking the Azure AI Agent Service logs for any error messages or warnings that occur during these file operations. They often provide more detailed information about what’s causing the hang.

If none of these solve the issue, you might want to open a support ticket with Azure. They can dive deeper into your specific setup and provide more tailored assistance.