Skip to content

Commit

Permalink
Remove run_as from the built-in templates (#2044)
Browse files Browse the repository at this point in the history
## Changes

This removes the `run-as` property from the default templates. It's a
useful property but it still only works for jobs and it makes the
default databricks.yml a bit longer. It seems like users can just learn
about it from the docs and/or vary their deployment identity.

Depends on #1712.
  • Loading branch information
lennartkats-db authored Feb 24, 2025
1 parent ddcfac5 commit f99716b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,21 @@ include:
# The default schema, catalog, etc. for dbt are defined in dbt_profiles/profiles.yml
targets:
dev:
default: true
# The default target uses 'mode: development' to create a development copy.
# - Deployed resources get prefixed with '[dev my_user_name]'
# - Any job schedules and triggers are paused by default.
# See also https://docs.databricks.com/dev-tools/bundles/deployment-modes.html.
mode: development
default: true
workspace:
host: [DATABRICKS_URL]

prod:
mode: production
workspace:
host: [DATABRICKS_URL]
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ targets:
mode: production
workspace:
host: [DATABRICKS_URL]
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ targets:
mode: production
workspace:
host: [DATABRICKS_URL]
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
variables:
warehouse_id: f00dcafe
Expand All @@ -44,5 +44,3 @@ targets:
permissions:
- user_name: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,21 @@ include:
# The default schema, catalog, etc. for dbt are defined in dbt_profiles/profiles.yml
targets:
dev:
default: true
# The default target uses 'mode: development' to create a development copy.
# - Deployed resources get prefixed with '[dev my_user_name]'
# - Any job schedules and triggers are paused by default.
# See also https://docs.databricks.com/dev-tools/bundles/deployment-modes.html.
mode: development
default: true
workspace:
host: {{workspace_host}}

prod:
mode: production
workspace:
host: {{workspace_host}}
# We explicitly specify /Workspace/Users/{{user_name}} to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/{{user_name}} to make sure we only have a single copy.
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}
permissions:
- {{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
level: CAN_MANAGE
run_as:
{{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ targets:
mode: production
workspace:
host: {{workspace_host}}
# We explicitly specify /Workspace/Users/{{user_name}} to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/{{user_name}} to make sure we only have a single copy.
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}
permissions:
- {{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
level: CAN_MANAGE
run_as:
{{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ targets:
mode: production
workspace:
host: {{workspace_host}}
# We explicitly specify /Workspace/Users/{{user_name}} to make sure we only have a single copy.
# We explicitly deploy to /Workspace/Users/{{user_name}} to make sure we only have a single copy.
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}
variables:
warehouse_id: {{index ((regexp "[^/]+$").FindStringSubmatch .http_path) 0}}
Expand All @@ -51,5 +51,3 @@ targets:
permissions:
- {{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
level: CAN_MANAGE
run_as:
{{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}

0 comments on commit f99716b

Please sign in to comment.