<?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 Error authenticating databricks.sdk.WorkspaceClient with external workspace via Azure Native Auth in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/error-authenticating-databricks-sdk-workspaceclient-with/m-p/58630#M6421</link>
    <description>&lt;P&gt;I am referencing&amp;nbsp;&lt;A href="https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html#azure-native-authentication" target="_blank" rel="noopener"&gt;this doc&lt;/A&gt;&amp;nbsp;to initialize a&amp;nbsp;databricks.sdk.WorkspaceClient object instance via Azure Native Authentication. I am initializing this WorkspaceClient within a databricks notebook, but I am trying to use the client to access the Jobs api of a different databricks workspace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I am getting says:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;ValueError: &lt;/SPAN&gt;&lt;SPAN&gt;default auth: azure-client-secret: Cannot resolve Azure Databricks workspace: b'{"error":{"code":"MissingSubscription","message":"The request did not have a subscription or a valid tenant level resource provider."}}'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here is a heavily redacted picture of the code I am running:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6012i890DFCA794CCE358/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe my issue might be with the azure_workspace_resource_id field. Currently, I am filling that field with the workspace ID for the databricks workspace for which I would like to run WorkspaceClient.jobs methods. The docs describe this field as:&lt;BR /&gt;&lt;BR /&gt;"&lt;SPAN&gt;The Azure Resource Manager ID for the Azure Databricks workspace, which is exchanged for a Databricks host URL."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why am I doing this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;I want to check the status of a Databricks job that runs outside of my current Databricks workspace. For production, I would like to authenticate with the Jobs API without using my own personal access token, and the &lt;A href="https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html" target="_self"&gt;Databricks OAuth M2M docs&lt;/A&gt;&amp;nbsp;suggest using the WorkspaceClient to accomplish this.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is the azure_workspace_resource_id not the same as the Databricks workspace ID?&lt;/LI&gt;&lt;LI&gt;Does this Azure service principle need to be added as a Databricks service principle in order for this authentication to succeed?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2024 21:03:16 GMT</pubDate>
    <dc:creator>hayden_blair</dc:creator>
    <dc:date>2024-01-29T21:03:16Z</dc:date>
    <item>
      <title>Error authenticating databricks.sdk.WorkspaceClient with external workspace via Azure Native Auth</title>
      <link>https://community.databricks.com/t5/get-started-discussions/error-authenticating-databricks-sdk-workspaceclient-with/m-p/58630#M6421</link>
      <description>&lt;P&gt;I am referencing&amp;nbsp;&lt;A href="https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html#azure-native-authentication" target="_blank" rel="noopener"&gt;this doc&lt;/A&gt;&amp;nbsp;to initialize a&amp;nbsp;databricks.sdk.WorkspaceClient object instance via Azure Native Authentication. I am initializing this WorkspaceClient within a databricks notebook, but I am trying to use the client to access the Jobs api of a different databricks workspace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I am getting says:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;ValueError: &lt;/SPAN&gt;&lt;SPAN&gt;default auth: azure-client-secret: Cannot resolve Azure Databricks workspace: b'{"error":{"code":"MissingSubscription","message":"The request did not have a subscription or a valid tenant level resource provider."}}'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here is a heavily redacted picture of the code I am running:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6012i890DFCA794CCE358/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe my issue might be with the azure_workspace_resource_id field. Currently, I am filling that field with the workspace ID for the databricks workspace for which I would like to run WorkspaceClient.jobs methods. The docs describe this field as:&lt;BR /&gt;&lt;BR /&gt;"&lt;SPAN&gt;The Azure Resource Manager ID for the Azure Databricks workspace, which is exchanged for a Databricks host URL."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why am I doing this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;I want to check the status of a Databricks job that runs outside of my current Databricks workspace. For production, I would like to authenticate with the Jobs API without using my own personal access token, and the &lt;A href="https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html" target="_self"&gt;Databricks OAuth M2M docs&lt;/A&gt;&amp;nbsp;suggest using the WorkspaceClient to accomplish this.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is the azure_workspace_resource_id not the same as the Databricks workspace ID?&lt;/LI&gt;&lt;LI&gt;Does this Azure service principle need to be added as a Databricks service principle in order for this authentication to succeed?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 21:03:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/error-authenticating-databricks-sdk-workspaceclient-with/m-p/58630#M6421</guid>
      <dc:creator>hayden_blair</dc:creator>
      <dc:date>2024-01-29T21:03:16Z</dc:date>
    </item>
  </channel>
</rss>

