Open GautamKumarSkyPointCloud opened 2 years ago
same problem here, with the AzureBlobDatastore example
Which example? Describe the issue
Code Snippet: from azure.ai.ml.entities import ( AzureDataLakeGen2Datastore ) adlsg2_datastore = AzureDataLakeGen2Datastore( name="adls-gen2-example", description="Datastore pointing to an Azure Data Lake Storage Gen2.", account_name="mytestdatalakegen2", filesystem="my-gen2-container", credentials={ "tenant_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "client_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", }, ) ml_client.create_or_update(adlsg2_datastore)
Error: AttributeError: 'dict' object has no attribute '_to_rest_object'
Thank you for your feedback. The credentials field is not a raw dictionary, it is an object
from azure.ai.ml.entities._datastore.credentials import ServicePrincipalCredentials
credentials=ServicePrincipalCredentials(
tenant_id="00000000-0000-0000-0000-000000000000",
client_id="00000000-0000-0000-0000-000000000000",
client_secret="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
)
All the examples related to DS create for SDK have been updated in the online doc Use datastores - Azure Machine Learning | Microsoft Learn
It worked for me, thank you
Which example? Describe the issue
Code Snippet: from azure.ai.ml.entities import ( AzureDataLakeGen2Datastore ) adlsg2_datastore = AzureDataLakeGen2Datastore( name="adls-gen2-example", description="Datastore pointing to an Azure Data Lake Storage Gen2.", account_name="mytestdatalakegen2", filesystem="my-gen2-container", credentials={ "tenant_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "client_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", }, ) ml_client.create_or_update(adlsg2_datastore)
Error: AttributeError: 'dict' object has no attribute '_to_rest_object'