Query serverless SQL pool external view/ tables from an Apache Spark python notebook using AAD authentication

Srinivasarao Doma 0 Reputation points
2023-06-13T02:28:59.57+00:00

Serverless SQL pool which contains external tables/Views write against ADLS Gen2 parquet files.

Want to query external table / views from synapse spark notebook using python.

Server less SQL Pool is using Azure Active directory.

Can you please let me know how can achieve this.

Thank you,

Sri

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,357 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247 34,491 Reputation points MVP Volunteer Moderator
    2023-06-13T15:27:37.9933333+00:00

    Hi,

    Thanks for reaching out to Microsoft Q&A.

    You can use pyspark to query the data from sql pool., let me know if this is what you are looking for?

    https://vinsdata.wordpress.com/2022/03/03/create-synapse-notebook-and-run-python-and-sql-under-spark-pool/

    https://learn.microsoft.com/en-us/azure/synapse-analytics/get-started-analyze-spark#main

    Please Upvote and Accept as answer if the reply was helpful, this will be benefitting the other community members who go through the same issue.


  2. Bhargava-MSFT 31,256 Reputation points Microsoft Employee Moderator
    2023-06-14T19:02:29.1066667+00:00

    Hello Srinivas Doma,

    To connect Serverless SQL pool with Synapse python notebook with Azure AD authentication, You will need to install ADAL4j library on your spark pool.

    See this stackoverflow thread for more details.

    Please try the solution and let us know if you have any further questions.


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.