Azure / Azure/azure-sdk-for-python
Unsupported auth type AccountManagedIdentity when uploading dataset
- 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.1
- **Operating System**: Windows 11
- **Python Version**: 3.13.7
**Describe the bug**
Calling `project_client.datasets.upload_file()` on an **AI Services-backed AI Foundry project** (new `CognitiveServices/accounts` model, not the legacy `MachineLearningServices/workspaces` model) fails with a `400 BadRequest` error:
```
Unsupported auth type AccountManagedIdentity
```
The error originates from the asset store backend at:
```
POST https://eastus2.api.azureml.ms/assetstore/v1.0/temporaryDataReference/createOrGet
```
The AI Foundry hub is configured with:
- **Identity type**: `UserAssigned` managed identity
- **`systemDatastoresAuthMode`**: `"Identity"`
This is **not** limited to the SDK — the same error also occurs when attempting to upload a dataset through the **Azure AI Foundry portal UI**, confirming this is a backend/platform-level issue rather than an SDK bug.
**To Reproduce**
1. Deploy an AI Services-backed AI Foundry hub (`Microsoft.MachineLearningServices/workspaces`, `kind: "Hub"`) with:
- `UserAssigned` managed identity
- `systemDatastoresAuthMode = "Identity"`
2. Deploy an AI Foundry project under the hub
3. Download the sample data set from the eval portal
4. Run the following Python script:
```python
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
project_client = AIProjectClient(
endpoint="https://.services.ai.azure.com/api/projects/",
credential=DefaultAzureCredential(),
)
dataset = project_client.datasets.upload_file(
name="my_dataset",
version="1",
file_path="./sample.jsonl",
)
```
5. Observe the error:
```
azure.core.exceptions.HttpResponseError: (ServiceError) Received 400 from a service request
Code: ServiceError
Message: Received 400 from a service request
Target: POST https://eastus2.api.azureml.ms/assetstore/v1.0/temporaryDataReference/createOrGet
(BadRequest) "Unsupported auth type AccountManagedIdentity"
```
6.. Attempt the same upload via the Azure AI Foundry portal UI → same error.
**Expected behavior**
`datasets.upload_file()` should succeed when the hub is configured with `systemDatastoresAuthMode = "Identity"` and a UserAssigned managed identity. The asset store's `temporaryDataReference/createOrGet` endpoint should support the `AccountManagedIdentity` auth type for AI Services-backed projects.
**Screenshots**
UI Error (same as python sdk error)
**Additional context**
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.