Service Principal Set Up for Test Deployment - pathfinder-analytics-uk/dab_project GitHub Wiki

Project Code

databricks.yml

# This is a Databricks asset bundle definition for dab_project.
# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation.
bundle:
  name: dab_project

include:
  - resources/*.yml

variables:
  catalog:
    default: "citibike_dev"
  dev_flag:
    default: true

targets:
  dev:
    # 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: your-workspace-url # replace with your Workspace URL

  test:
    mode: production
    variables:
      catalog:
        default: "citibike_test"
      dev_flag:
        default: false
    presets:
      name_prefix: '[testing] '
    workspace:
      host: your-workspace-url # replace with your Workspace URL
      root_path: /Workspace/Shared/.bundle/${bundle.name}/${bundle.target}
    permissions:
      - service_principal_name: your-service-principal-name # update with your service principal name
        level: CAN_MANAGE
    run_as:
      service_principal_name: your-service-principal-name # update with your service principal name

  prod:
    mode: production
    variables:
      catalog:
        default: "citibike_prod"
      dev_flag:
        default: false
    workspace:
      host: your-workspace-url # replace with your Workspace URL
      root_path: /Workspace/Shared/.bundle/${bundle.name}/${bundle.target}
    permissions:
      - user_name: your-user-name # update with your service principal name
        level: CAN_MANAGE
    run_as:
      user_name: your-user-name # update with your service principal name