cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Not able to set run_as service_principal_name

drag7ter
New Contributor II

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

1 ACCEPTED SOLUTION

Accepted Solutions

drag7ter
New Contributor II

In my case I replaced alias PROD_Service_Principal with id c250831b-5a2a-4461-a855-83b9102f797e and it works. Not intuitive, probably this is a bug in CLI ot bundles

 

service_principal_name: c250831b-5a2a-4461-a855-83b9102f797e

 

 

View solution in original post

2 REPLIES 2

drag7ter
New Contributor II

I want to add that even if I specify:

    run_as:
      user_name: c250831b-5a2a-4461-a855-83b9102f797e

It doesn't work:

Error: cannot create job: 'c250831b-5a2a-4461-a855-83b9102f797e' cannot be set as run_as, either because the user does not exist or it is not active.

drag7ter
New Contributor II

In my case I replaced alias PROD_Service_Principal with id c250831b-5a2a-4461-a855-83b9102f797e and it works. Not intuitive, probably this is a bug in CLI ot bundles

 

service_principal_name: c250831b-5a2a-4461-a855-83b9102f797e

 

 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.