Skip to content

lookup: service_principal not giving correct id #1234

@kenmyers-8451

Description

@kenmyers-8451

Describe the issue

I'm trying to look up the service principal id to pass to the run_as paramater of a workflow. Look up grabs an ID but it is not the azure app id I expected and need to pass to the run_as param. It's a 16 digit code like "5661************" (redacted because I'm not sure what this is, is it some sort of databricks side ID rather than the app id?).

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Set up a variable to look up a service principal by name (ours was spTm{teamname}tst, try this on tst environment)
  2. Run databricks bundle deploy -p tst -t tst (I have a tst profile and tst target for a corresponding tst databricks environment)
  3. Error because 16-digit code is pulled instead of app id, error="terraform apply: exit status 1\n\nError: cannot update job: '5661************' cannot be set as run_as_username, either because the user does not exist or is not a service principal.

Expected Behavior

I expected it to look up the app id (ie 83f70c70---****-********a33a) because this seems to be what is needed if I hard code it.

image

Actual Behavior

Different ID seems to get pulled

OS and CLI version

v0.214.0, macos 14.3

Is this a regression?

N/A

Debug Logs

I can add more of these but the logs don't have much information about where the ID comes from. here is the root of the error

< HTTP/2.0 200 OK
< {} pid=26476 mutator=seq mutator=deploy mutator=seq mutator=seq mutator=deferred mutator=lock:release sdk=true
17:57:18 ERROR Error: terraform apply: exit status 1

Error: cannot update job: '5661************' cannot be set as run_as_username, either because the user does not exist or is not a service principal.

  with databricks_job.{job name},
  on bundle.tf.json line 778, in resource.databricks_job.{job name}:
 778:       },

Metadata

Metadata

Assignees

Labels

DABsDABs related issuesEnhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions