Skip to content

azure-ai-projects async AIProjectClient should install aiohttp transport dependency #47539

@eavanvalkenburg

Description

@eavanvalkenburg

Library name

azure-ai-projects

Library version

2.2.0

Description

Installing azure-ai-projects by itself does not install aiohttp, but constructing the async azure.ai.projects.aio.AIProjectClient requires the Azure Core aio transport and fails with ModuleNotFoundError: No module named 'aiohttp'.

azure-ai-projects==2.2.0 declares dependencies on plain azure-core, azure-identity, azure-storage-blob, isodate, openai, and typing-extensions. aiohttp is only provided by the optional azure-core[aio] extra, so users of the async Projects client do not receive the transport dependency transitively.

Microsoft Agent Framework depends on azure-ai-projects and exposes async Foundry clients (FoundryChatClient, FoundryAgent, memory provider) that construct azure.ai.projects.aio.AIProjectClient. We are adding a defensive direct aiohttp dependency in Agent Framework, but the Azure SDK package should also make its own async install surface complete.

Expected behavior

A user who installs azure-ai-projects should be able to construct azure.ai.projects.aio.AIProjectClient without separately knowing to install aiohttp or azure-core[aio].

Possible fixes include depending on azure-core[aio] or otherwise declaring the async transport dependency needed by azure.ai.projects.aio.

Actual behavior

Constructing AIProjectClient from azure.ai.projects.aio raises:

ModuleNotFoundError: No module named 'aiohttp'

Reproduction steps

python -m venv .venv
. .venv/bin/activate
pip install azure-ai-projects==2.2.0
python - <<'PY'
from azure.ai.projects.aio import AIProjectClient
from azure.core.credentials_async import AsyncTokenCredential

class Cred(AsyncTokenCredential):
    async def get_token(self, *scopes, **kwargs):
        raise RuntimeError("not expected")

    async def close(self):
        pass

AIProjectClient(
    endpoint="https://example.services.ai.azure.com/api/projects/project",
    credential=Cred(),
)
PY

Environment

Reproduced in a clean Python 3.12 environment. Package metadata inspection showed aiohttp was not installed and was not listed in azure-ai-projects==2.2.0 requirements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions