Wednesday, 13 February 2019

Why does my login to MS SQL with AzureML dataprep using Windows authentication fail?

I tried connecting to a MS SQL database using azureml.dataprep in an Azure Notebook, as outlined in https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-load-data, using MSSqlDataSource, using code of the form

import azureml.dataprep as dprep

secret = dprep.register_secret(value="[SECRET-PASSWORD]", id="[SECRET-ID]")

ds = dprep.MSSQLDataSource(server_name="[SERVER-NAME]",
                       database_name="[DATABASE-NAME], [PORT]",
                       user_name="[DATABASE-USERNAME]",
                       password=secret)

Setting [DATABASE-USERNAME] equal to MYWINDOWSDOMAIN\\MYWINDOWSUSERNAME and the password [SECRET-PASSWORD] coinciding with my Windows password (i.e. trying to use Windows authentication).

After firing a query with

dataflow = dprep.read_sql(ds, "SELECT top 100 * FROM [dbo].[MYTABLE]")
dataflow.head(5)

I get

ExecutionError: Login failed.

I could connect to other databases without Windows Authentication fine. What am I doing wrong?



from Why does my login to MS SQL with AzureML dataprep using Windows authentication fail?

No comments:

Post a Comment