I'm trying to run:
databricks bundle deploy -t prod --profile PROD_Service_Principal
My bundle looks:
bundle:
name: myproject
include:
- resources/jobs/bundles/*.yml
targets:
# The 'dev' target, for development purposes. This target is the default.
dev:
# We use 'mode: development' to indicate this is a personal development copy:
# - Deployed resources get prefixed with '[dev my_user_name]'
# - Any job schedules and triggers are paused by default
# - The 'development' mode is used for Delta Live Tables pipelines
mode: development
default: true
workspace:
host: https://myhost.cloud.databricks.com
# The 'prod' target, used for production deployment.
prod:
resources:
jobs:
my_job1:
schedule:
pause_status: UNPAUSED
# We use 'mode: production' to indicate this is a production deployment.
# Doing so enables strict verification of the settings below.
mode: production
workspace:
host: https://prod-host.cloud.databricks.com
root_path: /Users/application_id_of_my_service_principal/.bundle/${bundle.name}/${bundle.target}
run_as:
service_principal_name: PROD_Service_Principal
And I'm getting this error:
Updating deployment state...
Error: terraform apply: exit status 1
Error: cannot create job: 'PROD_Service_Principal' cannot be set as run_as_username, either because the user does not exist or is not a service principal.
Why I'm getting this error?
Why it tells me "can not set as run_as_username" I'm specifying not user_name but service_principal_name?
This service principal name exists and active in all workspaces