Copy Activity from Azure Databricks to AzureSQL

Jatinder Luthra 130 Reputation points
2023-12-11T20:26:26.0233333+00:00

Hello,

I am trying to get an output of SQL script from Azure Databricks source and copying to Azure SQL sink, in Azure data factory copy activity.

The copy activity is failing with error as below:

ErrorCode=AzureDatabricksCommandError,Hit an error when running the command in Azure Databricks. Error details: Failure to initialize configuration for storage account dlpxdatabricks.dfs.core.windows.net: Invalid configuration value detected for fs.azure.account.keyInvalid configuration value detected for fs.azure.account.key
Caused by: Invalid configuration value detected for fs.azure.account.key.

I know that I can't use storage account access key to access data using the abfss protocol, which I am not using. All linked services are using System Managed Identity

Azure SQL Database
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,514 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

Accepted answer
  1. phemanth 15,755 Reputation points Microsoft External Staff Moderator
    2023-12-18T09:41:25.88+00:00

    @Jatinder Luthra

    Thanks for reaching MS Q&A

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .

    Ask:

    I am trying to get an output of SQL script from Azure Databricks source and copying to Azure SQL sink, in Azure data factory copy activity.

    The copy activity is failing with error as below:

    YAMLAI ConvertCopy

    ErrorCode=AzureDatabricksCommandError,Hit an error when running the command in Azure Databricks. Error details: Failure to initialize configuration for storage account dlpxdatabricks.dfs.core.windows.net: Invalid configuration value detected for fs.azure.account.keyInvalid configuration value detected for fs.azure.account.key
    Caused by: Invalid configuration value detected for fs.azure.account.key.
    

    I know that I can't use storage account access key to access data using the abfss protocol, which I am not using. All linked services are using System Managed Identity

    Solution:

    the root cause. It was about databricks cluster configuration which was not specified in MSFT docs but found in databricks doc, https://docs.databricks.com/en/storage/azure-storage.html

    Adding below in databricks cluster configuration fixed issue for me in ADF.

    
    fs.azure.account.auth.type.<storage-account>.dfs.core.windows.net OAuth
    fs.azure.account.oauth.provider.type.<storage-account>.dfs.core.windows.net org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
    fs.azure.account.oauth2.client.id.<storage-account>.dfs.core.windows.net <application-id>
    fs.azure.account.oauth2.client.secret.<storage-account>.dfs.core.windows.net {{secrets/<secret-scope>/<service-credential-key>}}
    fs.azure.account.oauth2.client.endpoint.<storage-account>.dfs.core.windows.net https://login.microsoftonline.com/<directory-id>/oauth2/token
      
    

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    I hope this helps!

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.