Forum Discussion
yllsuarez76
1 year agoMicrosoft 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\sq...
- 1 year ago
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.
v-priyankata
1 year agoCommunity 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.