Skip to content

AzureML SDK - No module named 'azure.ai.ml.entities._datastore.credentials' #37704

Closed
@edgBR

Description

@edgBR
  • Package Name: azure-ai-ml
  • Package Version: 1.20.0
  • Operating System: Linux 24.09.23 - Ubuntu 20.04.6 LTS (AzureML compute Instance)
  • Python Version: 3.10.4

Describe the bug
It seems that documentation is incorrect regarding AzureML Datastores as the SDK component doesnt exist

To Reproduce
Steps to reproduce the behavior:

  1. Follow this link: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-datastore?view=azureml-api-2&tabs=sdk-account-key%2Csdk-adls-sp%2Csdk-azfiles-accountkey%2Csdk-adlsgen1-identity-access%2Csdk-onelake-sp#create-an-azure-data-lake-storage-gen2-datastore

Run the following:

from azure.ai.ml.entities import AzureDataLakeGen2Datastore
from azure.ai.ml.entities._datastore.credentials import ServicePrincipalCredentials

from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = AzureDataLakeGen2Datastore(
    name="adls_gen2_example",
    description="Datastore pointing to an Azure Data Lake Storage Gen2.",
    account_name="mytestdatalakegen2",
    filesystem="my-gen2-container",
     credentials=ServicePrincipalCredentials(
        tenant_id= "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        client_id= "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        client_secret= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    ),
)

ml_client.create_or_update(store)

It will break in:

image

Expected behavior
I expect the documentation to be correct.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Machine LearningService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions