<?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 Re: Run Delta Live Tables as service principal in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/44457#M27654</link>
    <description>&lt;P&gt;Same here&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 09:58:06 GMT</pubDate>
    <dc:creator>serelk</dc:creator>
    <dc:date>2023-09-12T09:58:06Z</dc:date>
    <item>
      <title>Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/39585#M27024</link>
      <description>&lt;P&gt;How to run a delta live tables pipeline in production? It uses the owner's (creator's) permissions for writing to tables, and I can't change the owner of a UC-enabled pipeline after creation. I don't want regular users to have write access to prod tables, but run as a service principal instead.&lt;/P&gt;&lt;P&gt;I can find no example in the documentation, but it seems like such a glaring shortcoming that I am sure I must have missed something.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 08:12:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/39585#M27024</guid>
      <dc:creator>knutasm</dc:creator>
      <dc:date>2023-08-11T08:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/39627#M27040</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;However, like you say the owner of the pipeline cannot be changed once set for a UC pipeline. Yet I am unable to choose pipeline owner when creating the pipeline in the first place, which is where I would have to set the service principal. I am also unable to create a pipeline as a service principal.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 11:21:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/39627#M27040</guid>
      <dc:creator>knutasm</dc:creator>
      <dc:date>2023-08-11T11:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/43836#M27557</link>
      <description>&lt;P&gt;Have the same issue.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 15:13:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/43836#M27557</guid>
      <dc:creator>Oliver_Angelil</dc:creator>
      <dc:date>2023-09-06T15:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/44457#M27654</link>
      <description>&lt;P&gt;Same here&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 09:58:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/44457#M27654</guid>
      <dc:creator>serelk</dc:creator>
      <dc:date>2023-09-12T09:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/50282#M28751</link>
      <description>&lt;P&gt;same!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:26:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/50282#M28751</guid>
      <dc:creator>js54123875</dc:creator>
      <dc:date>2023-11-01T15:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/51928#M29354</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/86288"&gt;@knutasm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;However, like you say the owner of the pipeline cannot be changed once set for a UC pipeline. Yet I am unable to choose pipeline owner when creating the pipeline in the first place, which is where I would have to set the service principal. I am also unable to create a pipeline as a service principal.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Hmm.&amp;nbsp; I wonder if creating the pipeline could it be done with the API?&amp;nbsp; I've not seen anything about that in my browsing around.&amp;nbsp; Even if it that's an option, I wouldn't say that's an ideal option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to assume that DLT with UC is simply not finished baking yet and that this will change sometime...&amp;nbsp; In the meantime, I might not jump in to DLT with both feet just yet.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 23:41:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/51928#M29354</guid>
      <dc:creator>ilarsen</dc:creator>
      <dc:date>2023-11-14T23:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/110068#M43477</link>
      <description>&lt;H2&gt;Configure pipeline permissions&lt;/H2&gt;&lt;P&gt;You must have the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;CAN&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;MANAGE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;IS&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;OWNER&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;permission on the pipeline to manage permissions. Pipelines use access control lists (ACLs) to control permissions. For a complete list of permissions and their abilities.&lt;/P&gt;&lt;OL class=""&gt;&lt;LI&gt;&lt;P&gt;In the sidebar, click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Delta Live Tables&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Select the name of a pipeline.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Share&lt;/STRONG&gt;. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Permissions Settings&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dialog appears.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Select User, Group or Service Principal…&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and select a user, group, or service principal.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Select a permission from the permission drop-down menu.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Add&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 13 Feb 2025 03:00:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/110068#M43477</guid>
      <dc:creator>AmanSehgal</dc:creator>
      <dc:date>2025-02-13T03:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Run Delta Live Tables as service principal</title>
      <link>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/111698#M43975</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/86288"&gt;@knutasm&lt;/a&gt;I have build the solution for it. The way to create DLT pipeline using SPN is to write a code wherein via databricks API a new DLT pipeline will be created and you mentioned owner as a service principal in the API code as shown below. Below method worked for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import requests

import requests
from azure.identity import ClientSecretCredential

databricks_instance = ""
client_id = dbutils.secrets.get(scope="", key="")
client_secret = dbutils.secrets.get(scope="", key="")
tenant_id = ""
#pipeline_id = ""

# Obtain token
token_response = requests.post(
    f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token",
    data={
        'grant_type': 'client_credentials',
        'client_id': client_id,
        'client_secret': client_secret,
        'scope': '2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default'
    }
)

access_token = token_response.json().get("access_token")

if not access_token:
    print(f"Error obtaining token: {token_response.text}")
else:
    headers = {
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/json'
    }

    # Define the pipeline creation payload using Unity Catalog
    create_pipeline_payload = {
        "name": "",
        "catalog": "",  # Specify the Unity Catalog name
        "target": "",    # Specify the schema within the Unity Catalog
        "clusters": [
            {
            "label": "default",
            "node_type_id": "Standard_DS3_v2",
            "autoscale": {
                "min_workers": 1,
                "max_workers": 2,
                "mode": "ENHANCED"
            }
            }
        ],
        "libraries": [
            {
            "notebook": {
                "path": ""
            }
            }
        ],
        "permissions": [
            {
                "service_principal_name": '',
                "permission_level": "IS_OWNER"  # Set the desired permission level
            }
        ],
        "development": True  # Set to False for production mode
    }

    # Make the API request to create the pipeline
    response = requests.post(
        f'{databricks_instance}/api/2.0/pipelines',
        headers=headers,
        json=create_pipeline_payload
    )

    # Check the response
    if response.status_code == 200:
        pipeline_id = response.json().get("pipeline_id")
        print(f"Pipeline created successfully with ID: {pipeline_id}")
    else:
        print(f"Failed to create pipeline: {response.status_code}, {response.text}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 12:32:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-delta-live-tables-as-service-principal/m-p/111698#M43975</guid>
      <dc:creator>ashwini0723</dc:creator>
      <dc:date>2025-03-04T12:32:13Z</dc:date>
    </item>
  </channel>
</rss>

