Azure / Azure/azure-sdk-for-python

Can't call embeddings from azure-ai-projects OpenAI client

Open
#44,532 4 comments 0 reactions 1 assignee Claimed by @howieleung View on GitHub
AI Projects Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: azure-ai-projects
- **Package Version**: 2.0.0b2
- **Operating System**: macOS 26.2
- **Python Version**: 3.13.11

**Describe the bug**

Trying to use `openai_client.embeddings.create` in conjunction with `openai_client.embeddings.create` only yields `404` responses. Embedding model is deployed in Foundry.

**To Reproduce**
Steps to reproduce the behavior:

```python
self._project = AIProjectClient(
endpoint=self.settings.AZURE_AI_PROJECT_ENDPOINT,
credential=DefaultAzureCredential(),
)
openai_client = self._project.get_openai_client()
embedding = await openai_client.embeddings.create(
model=self.settings.AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME,
input=query,
)
```
with `AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=text-embedding-ada-002`

**Expected behavior**

Embeddings are generated successfully.

**Additional context**

Logs:

```text
[get_openai_client] Creating OpenAI client using Entra ID authentication, base_url = `https://aif--dev.services.ai.azure.com/api/projects/proj-default/openai`

==> Request:
POST https://aif--dev.services.ai.azure.com/api/projects/proj-default/openai/embeddings?api-version=2025-11-15-preview

<== Response:
404 Not Found
Headers:
apim-request-id: e632ab44-d83a-4e68-8332-2640bb30b468
azureml-served-by-cluster: hyena-swedencentral-02
```

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.