Issue: Azure AI Agent Service retains reference to removed connections

I’m having trouble with the Azure AI Agent Service. Even though I don’t have any agents, when I try to list them using project_client.agents.list_agents(), I get an empty result as expected. But here’s the weird part:

If I remove an Azure AI search connection, I can’t use that command anymore. It gives me an error saying it can’t find the connection, even though it’s not being used by any agents.

# This works fine before deleting the connection
result = project_client.agents.list_agents()
print(result)  # Shows empty list

# After deleting the connection, this fails
project_client.agents.list_agents()  # Throws DecodeError

I’ve tried creating a new connection with a different name, but it doesn’t help. Any agent-related actions like listing agents or files fail because it’s still looking for the old connection.

Right now, the only fix I’ve found is to never delete the original connection. Has anyone else run into this? Is there a way to completely remove the reference to a deleted connection?

ugh, that sounds like a pain! have you tried clearing your browser cache and cookies? sometimes that helps with weird api issues. also, maybe check if there’s a way to force-refresh the connection list? could be some stale data hanging around. keep us posted if u figure it out!

I’ve dealt with this exact issue before, and it’s definitely a headache. One workaround I found was to use the Azure Portal instead of the SDK for managing connections. Through the portal, I was able to completely remove the old connection and create a new one without any lingering references.

Another thing that helped was to double-check the IAM permissions for your service principal or user account. Sometimes, permission issues can cause unexpected behavior like this. Make sure you have the necessary ‘Contributor’ or ‘Owner’ roles assigned.

If all else fails, you might need to create a new project and migrate your work. It’s not ideal, but it can save time compared to wrestling with a buggy project. Remember to export any important configurations or data before starting fresh.

Lastly, don’t forget to report this to Azure support. The more people report these issues, the higher priority they’ll get for fixes in future updates.

yo, that’s a real pain! have u tried clearing the azure cache? sometimes that helps with weird stuff like this. maybe try using the REST API directly instead of the SDK? could bypass whatever’s causing the issue. if nothing works, might be time to bug azure support. they should sort this out. good luck mate!

I’ve encountered a similar issue with Azure AI Agent Service. One thing that worked for me was to use the Azure Resource Manager (ARM) REST API to manually delete the connection resource. This approach sometimes bypasses the SDK’s caching mechanisms.

Another potential solution is to check for any orphaned resources in your Azure subscription. Occasionally, deleting a connection through the SDK doesn’t fully remove all associated resources, leading to these strange behaviors.

If these don’t work, you might want to consider using Azure PowerShell cmdlets instead of the Python SDK. They sometimes offer more granular control over resource management.

Lastly, ensure your Azure CLI is up-to-date, as older versions can sometimes cause inconsistencies with resource management. If the problem persists, definitely escalate this to Azure support with a detailed reproduction scenario.

I’ve encountered a similar issue with the Azure AI Agent Service. It appears there might be some caching or persistence of connection references that doesn’t get properly cleared upon deletion. Have you tried using the Azure CLI or REST API to manage the connections instead of the Python SDK? Sometimes, these alternative methods can bypass such quirks in the system. Additionally, ensure you’re using the latest version of the Azure SDK for Python, as older versions might have unresolved bugs. If the problem persists, it would be worthwhile to file a detailed bug report with Microsoft’s Azure team, including your exact steps to reproduce the issue.

hey there, i’ve run into this too. super frustrating! seems like a bug in the service. have u tried deleting the whole project and starting over? that worked for me once. also, maybe reach out to azure support? they might have a fix or workaround that’s not public yet. good luck!