Azure / Azure/azure-sdk-for-python

AIProjectClient: add AzureKeyCredential support for simple API‑key auth

Open
#42,236 23 comments 26 reactions 1 assignee Claimed by @dargilco View on GitHub
AI Projects Client customer-reported feature-request needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

### Library

- `azure-ai-projects` (preview)
Package path: [`sdk/ai/azure-ai-projects`](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ai/azure-ai-projects)

### Feature request

Please allow `AIProjectClient` to be instantiated with **`AzureKeyCredential`** so that customers can authenticate with a basic API key, matching the experience found in other SDKs.

### Current behaviour

`AIProjectClient` today only accepts a `TokenCredential`‑derived object:

* [Class definition](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py#L26-L35)
* Underlying configuration that wires only bearer‑token auth → [`_configuration.py`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py#L16-L50)

Consequently, users who obtain an **API key** from the Azure AI Foundry portal (`ai.azure.com`) or from ARM/Portal blades cannot drop directly into the Python SDK without also setting up an AAD application, service principal, or managed identity. This gap is a frequent paper‑cut for rapid prototyping and for customers whose security posture relies exclusively on key‑based auth.

### Desired behaviour

Provide parity with clients such as `AzureOpenAIClient`, `DocumentTranslationClient`, and others that support:

```python
from azure.ai.projects import AIProjectClient
from azure.core.credentials import AzureKeyCredential

client = AIProjectClient(
endpoint="https://.openai.azure.com",
credential=AzureKeyCredential("")
)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.