Azure / Azure/azure-sdk-for-python

mltable ignoring ml_client credentials

Aperta
#41,792 0 commenti 0 reazioni 1 assegnatario Rivendicata da @vivram Vedi su GitHub
Client customer-reported dataprep Machine Learning ML-Assets needs-team-attention question Service Attention
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g
PR unite (30g)
217

Descrizione

- 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.