<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Not able to set run_as service_principal_name in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67171#M33295</link>
    <description>&lt;P&gt;I'm trying to run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;databricks bundle deploy -t prod --profile PROD_Service_Principal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My bundle looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why I'm getting this error?&lt;/P&gt;&lt;P&gt;Why it tells me "can not set as &lt;STRONG&gt;run_as_username&lt;/STRONG&gt;" I'm specifying not&amp;nbsp;&lt;STRONG&gt;user_name&amp;nbsp;&lt;/STRONG&gt;but&amp;nbsp;&lt;STRONG&gt;service_principal_name?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This service principal name &lt;STRONG&gt;exists and active&lt;/STRONG&gt; in all workspaces&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 09:19:29 GMT</pubDate>
    <dc:creator>drag7ter</dc:creator>
    <dc:date>2024-04-24T09:19:29Z</dc:date>
    <item>
      <title>Not able to set run_as service_principal_name</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67171#M33295</link>
      <description>&lt;P&gt;I'm trying to run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;databricks bundle deploy -t prod --profile PROD_Service_Principal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My bundle looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why I'm getting this error?&lt;/P&gt;&lt;P&gt;Why it tells me "can not set as &lt;STRONG&gt;run_as_username&lt;/STRONG&gt;" I'm specifying not&amp;nbsp;&lt;STRONG&gt;user_name&amp;nbsp;&lt;/STRONG&gt;but&amp;nbsp;&lt;STRONG&gt;service_principal_name?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This service principal name &lt;STRONG&gt;exists and active&lt;/STRONG&gt; in all workspaces&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 09:19:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67171#M33295</guid>
      <dc:creator>drag7ter</dc:creator>
      <dc:date>2024-04-24T09:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set run_as service_principal_name</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67175#M33297</link>
      <description>&lt;P&gt;I want to add that even if I specify:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    run_as:
      user_name: c250831b-5a2a-4461-a855-83b9102f797e&lt;/LI-CODE&gt;&lt;P&gt;It doesn't work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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.&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Apr 2024 09:51:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67175#M33297</guid>
      <dc:creator>drag7ter</dc:creator>
      <dc:date>2024-04-24T09:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set run_as service_principal_name</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67183#M33301</link>
      <description>&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;service_principal_name: c250831b-5a2a-4461-a855-83b9102f797e&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 12:55:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/67183#M33301</guid>
      <dc:creator>drag7ter</dc:creator>
      <dc:date>2024-04-24T12:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set run_as service_principal_name</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/87655#M37437</link>
      <description>&lt;P&gt;Building on this situation, I am seeing if I deploy a job using a service principal this way, I am getting something prepended to the job like `&lt;SPAN&gt;[dev f46583c2_8c9e_499f_8d41_823332bfd4473]&amp;nbsp;`. Is there a different way for me via bundling to change this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 00:03:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/87655#M37437</guid>
      <dc:creator>reidwil</dc:creator>
      <dc:date>2024-09-03T00:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set run_as service_principal_name</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/88053#M37474</link>
      <description>&lt;P&gt;This is a normal preset for the development mode. You can overwrite it :&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/bundles/deployment-modes" target="_blank"&gt;Databricks Asset Bundle deployment modes - Azure Databricks | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Or change the mode to production.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 13:16:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-set-run-as-service-principal-name/m-p/88053#M37474</guid>
      <dc:creator>thibault</dc:creator>
      <dc:date>2024-09-03T13:16:18Z</dc:date>
    </item>
  </channel>
</rss>

