<?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 Configure Service Principle access to GiLab in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/configure-service-principle-access-to-gilab/m-p/66599#M33161</link>
    <description>&lt;P&gt;I'm facing an issue while trying to run my job in db and my notebooks located in Git Lab. When I run job under my personal user_Id it works fine, because I added Git Lab token to my user_Id profile and job able to pull branch from repository. But when I change run as and choose&amp;nbsp;Service Principle id it fails with an error:&lt;/P&gt;&lt;P&gt;run failed with error message&lt;BR /&gt;Failed to access Git repository: PERMISSION_DENIED: Invalid Git provider credentials. Go to User Settings &amp;gt; Git Integration to ensure that:&lt;BR /&gt;1. You have entered a username with your Git provider credentials.&lt;BR /&gt;2. You have selected the correct Git provider with your credentials.&lt;BR /&gt;3. Your personal access token or app password has the correct repository access.&lt;BR /&gt;4. Your personal access token has not expired.&lt;BR /&gt;5. If you have single sign on enabled with your Git provider, be sure to authorize your token.&lt;/P&gt;&lt;P&gt;What has been done so far:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Job was created under my personal user_Id, but run as Service Principle id. The location of notebooks - Git Lab repository branch&lt;/LI&gt;&lt;LI&gt;In Git Lab I created PAT for my Git Lab personal ID git_lab_personal_user_Id&lt;/LI&gt;&lt;LI&gt;Service Principle was created in db account console and has admin access and assigned to workspace where job was created (if notebooks located in workspace job runs)&lt;/LI&gt;&lt;LI&gt;Under my personal db user_Id with (my PAT) I created a token for my&amp;nbsp;Service Principle here&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/tokenmanagement/createobotoken" target="_self"&gt;token-management on-behalf-of tokens&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Then I checked which git credentials my personal use_Id has in db&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/gitcredentials/list" target="_self"&gt;git-credentials&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    "credentials": [
        {
            "credential_id": 434149623900468,
            "git_provider": "gitLabEnterpriseEdition",
            "git_username": "git_lab_personal_user_Id"
        }
    ]&lt;/LI-CODE&gt;&lt;P&gt;6.&amp;nbsp;Then with a help of PAT, generated in step (4) I created git credentials for my Service Principle&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/gitcredentials/create" target="_self"&gt;POST git-credentials&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"personal_access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

"git_username": "git_lab_personal_user_Id",

"git_provider": "gitLabEnterpriseEdition"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here&amp;nbsp;"&lt;STRONG&gt;personal_access_token" &lt;/STRONG&gt;I've send in create git credentials for service principle -&amp;nbsp;is my PAT for my&amp;nbsp;&lt;STRONG&gt;git_lab_personal_user_Id&lt;/STRONG&gt; from Git Lab. I've just added it to Service principle for tests.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I thought it should work also with service principle as well as with my databricks personal user_Id in db.&lt;/P&gt;&lt;P&gt;Why I'm getting the error, which step I missed when I configured Service Principle to be able to pull from Git Lab repository?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed to access Git repository: PERMISSION_DENIED: Invalid Git provider credentials. Go to User Settings &amp;gt; Git Integration to ensure that:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm not able &lt;STRONG&gt;to Go to User Settings &amp;gt; Git Integration&amp;nbsp;&lt;/STRONG&gt;because I'm using Service Principle for Git lab and service principle doesn't have&amp;nbsp;&lt;STRONG&gt;User Settings&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2024 11:46:55 GMT</pubDate>
    <dc:creator>drag7ter</dc:creator>
    <dc:date>2024-04-18T11:46:55Z</dc:date>
    <item>
      <title>Configure Service Principle access to GiLab</title>
      <link>https://community.databricks.com/t5/data-engineering/configure-service-principle-access-to-gilab/m-p/66599#M33161</link>
      <description>&lt;P&gt;I'm facing an issue while trying to run my job in db and my notebooks located in Git Lab. When I run job under my personal user_Id it works fine, because I added Git Lab token to my user_Id profile and job able to pull branch from repository. But when I change run as and choose&amp;nbsp;Service Principle id it fails with an error:&lt;/P&gt;&lt;P&gt;run failed with error message&lt;BR /&gt;Failed to access Git repository: PERMISSION_DENIED: Invalid Git provider credentials. Go to User Settings &amp;gt; Git Integration to ensure that:&lt;BR /&gt;1. You have entered a username with your Git provider credentials.&lt;BR /&gt;2. You have selected the correct Git provider with your credentials.&lt;BR /&gt;3. Your personal access token or app password has the correct repository access.&lt;BR /&gt;4. Your personal access token has not expired.&lt;BR /&gt;5. If you have single sign on enabled with your Git provider, be sure to authorize your token.&lt;/P&gt;&lt;P&gt;What has been done so far:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Job was created under my personal user_Id, but run as Service Principle id. The location of notebooks - Git Lab repository branch&lt;/LI&gt;&lt;LI&gt;In Git Lab I created PAT for my Git Lab personal ID git_lab_personal_user_Id&lt;/LI&gt;&lt;LI&gt;Service Principle was created in db account console and has admin access and assigned to workspace where job was created (if notebooks located in workspace job runs)&lt;/LI&gt;&lt;LI&gt;Under my personal db user_Id with (my PAT) I created a token for my&amp;nbsp;Service Principle here&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/tokenmanagement/createobotoken" target="_self"&gt;token-management on-behalf-of tokens&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Then I checked which git credentials my personal use_Id has in db&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/gitcredentials/list" target="_self"&gt;git-credentials&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    "credentials": [
        {
            "credential_id": 434149623900468,
            "git_provider": "gitLabEnterpriseEdition",
            "git_username": "git_lab_personal_user_Id"
        }
    ]&lt;/LI-CODE&gt;&lt;P&gt;6.&amp;nbsp;Then with a help of PAT, generated in step (4) I created git credentials for my Service Principle&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/gitcredentials/create" target="_self"&gt;POST git-credentials&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"personal_access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

"git_username": "git_lab_personal_user_Id",

"git_provider": "gitLabEnterpriseEdition"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here&amp;nbsp;"&lt;STRONG&gt;personal_access_token" &lt;/STRONG&gt;I've send in create git credentials for service principle -&amp;nbsp;is my PAT for my&amp;nbsp;&lt;STRONG&gt;git_lab_personal_user_Id&lt;/STRONG&gt; from Git Lab. I've just added it to Service principle for tests.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I thought it should work also with service principle as well as with my databricks personal user_Id in db.&lt;/P&gt;&lt;P&gt;Why I'm getting the error, which step I missed when I configured Service Principle to be able to pull from Git Lab repository?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed to access Git repository: PERMISSION_DENIED: Invalid Git provider credentials. Go to User Settings &amp;gt; Git Integration to ensure that:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm not able &lt;STRONG&gt;to Go to User Settings &amp;gt; Git Integration&amp;nbsp;&lt;/STRONG&gt;because I'm using Service Principle for Git lab and service principle doesn't have&amp;nbsp;&lt;STRONG&gt;User Settings&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:46:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/configure-service-principle-access-to-gilab/m-p/66599#M33161</guid>
      <dc:creator>drag7ter</dc:creator>
      <dc:date>2024-04-18T11:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Service Principle access to GiLab</title>
      <link>https://community.databricks.com/t5/data-engineering/configure-service-principle-access-to-gilab/m-p/92113#M38359</link>
      <description>&lt;P&gt;Hello from the Databricks Git PM:&lt;/P&gt;
&lt;P&gt;We have a section in the documentation for setting up Git credentials for a SP. The important step is to use the OBO token for the SP when you call the git credential API.&amp;nbsp;&lt;A href="https://docs.databricks.com/en/repos/ci-cd-techniques-with-repos.html#use-a-service-principal-with-databricks-git-folders" target="_blank"&gt;https://docs.databricks.com/en/repos/ci-cd-techniques-with-repos.html#use-a-service-principal-with-databricks-git-folders&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps!&lt;/P&gt;
&lt;P&gt;Nicole&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 18:25:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/configure-service-principle-access-to-gilab/m-p/92113#M38359</guid>
      <dc:creator>nicole_lu_PM</dc:creator>
      <dc:date>2024-09-27T18:25:22Z</dc:date>
    </item>
  </channel>
</rss>

