Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.52k stars 2.75k forks source link

AzureDataLakeAnalyticsLinkedService() error on passing SecureString() to service_principal_key. azure-mgmt-datafactory #2268

Closed glstream closed 6 years ago

glstream commented 6 years ago

When calling the AzureDataLakeAnalyticsLinkedService() and running a u-sql activity in a pipeline I am getting an error on the pipe: 'Invalid credentials AADSTS50012: Invalid client secret is provided.'

I have verified that my service_principal_key is correct and have opened this piece of the pipeline and then manually entered my service_principal_key into the linked service in the portal and then the u-sql activity works fine.

adla_conn_string = AzureDataLakeAnalyticsLinkedService('myADLA'
                                        , tenant= tenantkey
                                        , service_principal_id=adla_spId
                                        , service_principal_key=SecureString('myCorrectSecret')
                                        , subscription_id=subscription_id
                                        , resource_group_name=rg_name
                                        , data_lake_analytics_uri='adl://myADLS.azuredatalakestore.net'
                                        )

Here is the fill error:

Activity usql-move failed: Failed to get access token by using service principal. ADAL Error: invalid_client, Error Message: AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided. Trace ID: 6ce84f70-b319-429a-aba6-0cfb8e8b0300 Correlation ID: e1942513-0da5-47ae-9937-dc7bb7f4be08 Timestamp: 2018-03-23 16:13:29Z.

20180323_092659
lmazuel commented 6 years ago

@hvermis ?

hvermis commented 6 years ago

@linda33wj, can you take a look at this one too?

ninishaha commented 6 years ago

@glstream you mean you're able to make it on portal with the same key but failed using python SDK? I'm trying to repro this issue.

glstream commented 6 years ago

@ninishaha Yes, after the run fails from the console using the SDK I can open the portal and edit the ADLA linked service by adding the same key I have used in the sdk script and it runs.

ninishaha commented 6 years ago

I can successfully create my linked service with python SDK. Looks like service principal key is wrong based on the that error message.

hvermis commented 6 years ago

@glstream Has this issue been resolved?

glstream commented 6 years ago

Yes, it has thank you.

On Tue, Jun 19, 2018 at 10:29 PM, hvermis notifications@github.com wrote:

@glstream https://github.com/glstream Has this issue been resolved?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-python/issues/2268#issuecomment-398628707, or mute the thread https://github.com/notifications/unsubscribe-auth/AG1rot2iEG_3ZksEyV5CUAZnvPETsuD2ks5t-d3CgaJpZM4S5BVV .