dataset.to_pandas_dataframe() throws a DatabaseConnectionException

GerhardH 6 Reputation points
2022-03-10T11:42:34.29+00:00

Hello,

I try to access a Azure ML Dataset in python and get the following error message:

Execution failed in operation 'to_pandas_dataframe' for Dataset(id='[data.id]', name='[data.name]', version=1, error_code=ScriptExecution.DatabaseConnection.Unexpected,error_message=ScriptExecutionException was caused by DatabaseConnectionException.\n  DatabaseConnectionException was caused by UnexpectedException.\n    'MSSQL' encountered unexpected exception of type 'AggregateException' with HResult 'x80131500' while opening connection to server ([REDACTED]), database ([REDACTED]).\n      Failed due to inner exception of type: AggregateException\n| session_id=[session-id]) ErrorCode: ScriptExecution.DatabaseConnection.Unexpected  

It is a Tabular Dataset created from a Azure SQL database datasource.
For the access from the studio to the database a service principal is used.
I can access all the resources mentioned above in the standard ui.

The "sample usage" in the "consume" tab of the dataset was used for accessing the dataset in python.
Regarding environments i tried python 3.6 and 3.8 locally and in a compute instance of the ML studio.
However the same error keeps coming.

I also tried to use sync-keys as described in this question:
https://learn.microsoft.com/en-us/answers/questions/644562/datasetto-pandas-dataframe-throws-a-scriptexecutio.html

Best Regards,
Gerhard

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,334 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GerhardH 6 Reputation points
    2022-03-11T09:21:44.827+00:00

    A DevOps-Colleague could find the cause of the problem. The service principal didn't have the correct rights for my use case.

    @romungi-MSFT : I'll try your suggestion since I can create a snapshot of the table.

    Thanks for your time and support!

    Cheers,
    Gerhard

    1 person found this answer helpful.
    0 comments No comments

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.