Skip to content

mltable ignoring ml_client credentials #41792

Open
@alpinedelight

Description

@alpinedelight
  • 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

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.ML-AssetsMachine LearningService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.dataprepIssues subcategorized for ML dataprep libraryneeds-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions