Authentication failed when accessing dataset in compute instance using its MSI via AzureML SDK v2

Shiyao Li 0 Reputation points Microsoft Employee
2024-06-14T22:27:10.02+00:00

The dataset can be previewed in AML workspace when the associated datastore is created using identity-based auth with workspace managed identity. I have the same user managed identity assigned to workspace and compute instance. But it only failed in compute instance while using below code snippet to access the dataset.

image

# Set your subscription, resource group and workspace name:

subscription_id = "xxx"

resource_group = "xxx"

workspace = "xxx"

# connect to the AzureML workspace

ml_client = MLClient(

DefaultAzureCredential(), subscription_id, resource_group, workspace

)

filedataset_asset = ml_client.data.get(name="xxx", version="1")

tbl = mltable.load(f'azureml:/{filedataset_asset.id}')

df = tbl.to_pandas_dataframe()

df

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,492 questions
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,978 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.