I am checking feasibility of switching from azure synapse to query data from Databricks parquet files mounted from Datalake and stored in DBFS at some path to Databricks SQL and statement API's.
I am not creating tables atm in SQL warehouse from the parquet files but directly fetching using statement API https://{{base-url}}/api/2.0/sql/statements/ and getting response in Json.
Earlier with azure synapse we could create login user and grant access and permissions using SQL server queries like below but not able to run these queries through Statement Api as I guess it des not support SQL server queries. I am able to use select, create table,view and schema queries but not the other queries.
using (var connection = await sqlManager.CreateAdminConnection(dbName).ConfigureAwait(false))
{
var sqlCreateSchema = $@"CREATE SCHEMA {schemaName}";
await sqlManager.ExecuteNonQuery(sqlCreateSchema, connection).ConfigureAwait(false);
var sqlCreateUser = $@"CREATE LOGIN {loginUser} With PASSWORD = '{loginPassword}'
CREATE USER {dbUser} FROM LOGIN {loginUser} WITH DEFAULT_SCHEMA = {schemaName}
DENY SELECT, EXECUTE On SCHEMA::sys To public
DENY SELECT On SCHEMA::INFORMATION_SCHEMA To public
GRANT SELECT ON SCHEMA :: {schemaName} TO {dbUser}
GRANT ADMINISTER DATABASE BULK OPERATIONS TO {dbUser}";
await sqlManager.ExecuteNonQuery(sqlCreateUser, connection).ConfigureAwait(false);
}
Is this possible to do assign permission through Api's to users in Databricks via this approach or alternate way ? I saw some create user Api's in document as well but that is creating user at workspace level if I am correct.
There are these ACL permission Api's as well but they need some object id as parameter which I not able to find and create.
Also when I use the Databricks inbuilt AI assistant, it gives answers using this some endpoints like https://{{base-url}}/api/2.0/sql/endpoints/create to run SQL queries which dont exist or not exist anymore