Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
yllsuarez76
Microsoft Employee
Microsoft Employee

How to write to a SQL endpoint from Notebook

I need to grant access (via code) to a Table in an specific schema for an Entra Security Group accesing a lakehouse using SQL endpoint.

 

I can run a sql query using GRANT statement in lakehouse\sql-endpoint UI, but the challenge is to run it from a junyper notebook.

1 ACCEPTED SOLUTION
v-priyankata
Community Support
Community Support

Hi @yllsuarez76  ,

You can execute a GRANT statement on a Fabric Lakehouse SQL Endpoint from a notebook by connecting to the endpoint using an ODBC connection. This allows you to run SQL commands, including permission-related queries, from your notebook.

Here’s how you can approach it:

  • Use a supported ODBC driver to connect to the SQL endpoint.
  • Establish a connection using valid authentication (such as a service principal or managed identity).
  • Execute the GRANT statement within the notebook to assign the necessary permissions.
  • Ensure that the user or security group has the appropriate privileges to modify permissions.

If this helps, then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.

Thank you. 

View solution in original post

4 REPLIES 4
v-priyankata
Community Support
Community Support

Hi @yllsuarez76 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-priyankata
Community Support
Community Support

Hi @yllsuarez76 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-priyankata
Community Support
Community Support

Hi @yllsuarez76 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

v-priyankata
Community Support
Community Support

Hi @yllsuarez76  ,

You can execute a GRANT statement on a Fabric Lakehouse SQL Endpoint from a notebook by connecting to the endpoint using an ODBC connection. This allows you to run SQL commands, including permission-related queries, from your notebook.

Here’s how you can approach it:

  • Use a supported ODBC driver to connect to the SQL endpoint.
  • Establish a connection using valid authentication (such as a service principal or managed identity).
  • Execute the GRANT statement within the notebook to assign the necessary permissions.
  • Ensure that the user or security group has the appropriate privileges to modify permissions.

If this helps, then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.

Thank you. 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.