Azure / Azure/azure-sdk-for-python

mltable ignoring ml_client credentials

Abierto
#41,792 0 comentarios 0 reacciones 1 asignado Reclamado por @vivram Ver en GitHub
Client customer-reported dataprep Machine Learning ML-Assets needs-team-attention question Service Attention
Lenguaje dominante
Python
Estrellas
5.6k
Forks
3.4k
Merge medio
2 d 2 h
PR fusionados (30 d)
213

Descripción

- mltable
- 1.6.1
- Fabric notebook
- 3.11

**Describe the bug**
mltable doesnt honour the ml_client credentials passed through, per https://learn.microsoft.com/en-us/python/api/mltable/mltable?view=azure-ml-py#mltable-load.
Whilst azure.ai.ml (workspace, datastores) successfully use the credentials (via devicecodeflow), mltable looks for creds, ignoring the ml_client passed through, and fails.

Code:
tbl = mltable.load(f"azureml:/{data_asset.id}", ml_client=ml_client)
Error:
ClientAuthenticationError: DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot this issue.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: PowerShell is not installed
AzureDeveloperCliCredential: Azure Developer CLI could not be found. Please visit https://aka.ms/azure-dev for installation instructions and then,once installed, authenticate to your Azure account using 'azd auth login'.
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.

Using devicecodeflow to support interactive data exploration from Fabric Notebooks.

**To Reproduce**
Steps to reproduce the behavior:
1. if credential is None:
credential = DeviceCodeCredential() #InteractiveBrowserCredential()

SUBSCRIPTION="3bb9fda7-7f70-47bb-b76e-4f4b934a93c3"
RESOURCE_GROUP="ai_neu_dev_rg"
WS_NAME="ai_neu_dev_aml"
# Get a handle to the workspace
ml_client = MLClient(
credential=credential,
subscription_id=SUBSCRIPTION,
resource_group_name=RESOURCE_GROUP,
workspace_name=WS_NAME,
)
ws = ml_client.workspaces.get(WS_NAME)
print(ws.location,":", ws.resource_group)
2. import mltable

datastore = ml_client.datastores.get("onelake_supply")
data_asset = ml_client.data.get("DeltaReader3", version="1")

# error here
tbl = mltable.load(f"azureml:/{data_asset.id}", ml_client=ml_client)

**Expected behavior**
To use creds and return delta lake data.

**Screenshots**
N/A

**Additional context**
N/A

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.