- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2025 04:26 AM
Hi Databricks community, I am currently tasked with creating a stream lit application with the help of data bricks application feature, I have currently created a lake base instance to sync the delta table located at the unity catalog and I have also created the application using stream lit and connected the lake base instance as backend and now I got a doubt, Is it possible to start/stop the lake base instance via the stream lit application Ui, if possible what are all the prerequisite access do I need to get in order to trigger lake base instance from my application and any code snippet that I can refer to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2025 10:42 AM - edited 12-06-2025 10:44 AM
Hi @RJTECHY210 ,
Yes, it's possible. You can use python sdk to achieve what you want. Here's a sample code for a reference:
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.database import DatabaseInstance
# Initialize the Workspace client
w = WorkspaceClient()
# Stop a database instance
instance_name = "my-database-instance"
w.database.update_database_instance(
name=instance_name,
database_instance=DatabaseInstance(
name=instance_name,
stopped=True
),
update_mask="*"
)
print(f"Stopped database instance: {instance_name}")
# Start a database instance
w.database.update_database_instance(
name=instance_name,
database_instance=DatabaseInstance(
name=instance_name,
stopped=False
),
update_mask="*"
)
print(f"Started database instance: {instance_name}")Also, don't forget to add proper permission for you databricks apps service principal. To be able to start and stop lakebase instance you need to have can manage permissions:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2025 08:24 AM
Hi @szymon_dybczak, Thanks for the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2025 02:14 PM
No problem @RJTECHY210 , happy coding!