Skip to content

Commit e0e9383

Browse files
authored
chore(template): auto-start apps on deploy via lifecycle.started (#454)
Add `lifecycle.started: true` to the scaffolded `databricks.yml` so a deploy leaves the app running and returns its URL, with no separate start step. Update the template README to use the single `databricks apps deploy` command instead of the `bundle deploy` + `bundle run` two-step. Resolves the friction where a scaffolded app required a manual `bundle run` / `apps start` after deploy. Co-authored-by: Isaac
1 parent d772f7c commit e0e9383

2 files changed

Lines changed: 11 additions & 17 deletions

File tree

template/README.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,37 +151,27 @@ targets:
151151
152152
Make sure to replace all placeholder values in `databricks.yml` with your actual resource IDs.
153153

154-
### 2. Validate Bundle
154+
### 2. Deploy
155155

156-
```bash
157-
databricks bundle validate
158-
```
159-
160-
### 3. Deploy
161-
162-
Deploy to the default target:
156+
Deploy and start the app with a single command:
163157

164158
```bash
165-
databricks bundle deploy
159+
databricks apps deploy
166160
```
167161

168-
### 4. Run
169-
170-
Start the deployed app:
171-
172-
```bash
173-
databricks bundle run <APP_NAME> -t dev
174-
```
162+
`databricks apps deploy` validates the project, deploys it, starts the app, and prints its URL.
175163

176164
### Deploy to Production
177165

178166
1. Configure the production target in `databricks.yml`
179167
2. Deploy to production:
180168

181169
```bash
182-
databricks bundle deploy -t prod
170+
databricks apps deploy -t prod
183171
```
184172

173+
> **Restarting a stopped app:** apps stop after a period of inactivity. To start one again without redeploying, run `databricks apps start <APP_NAME>`.
174+
185175
## Project Structure
186176

187177
```

template/databricks.yml.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ resources:
1313
description: "{{.appDescription}}"
1414
source_code_path: ./
1515

16+
# Start the app automatically on deploy.
17+
lifecycle:
18+
started: true
19+
1620
{{- if or .plugins.genie .plugins.files .plugins.serving}}
1721
user_api_scopes:
1822
{{- if .plugins.genie}}

0 commit comments

Comments
 (0)