<?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 Retrieve workspace instance name on E2 architecture (multi-tenant) in notebook running on job cluster in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/11998#M6871</link>
    <description>&lt;P&gt;I have a databricks job on E2 architecture in which I want to retrieve the workspace instance name within a notebook running in a Job cluster context so that I can use it further in my use case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While the call &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.notebook.entry_point.getDbutils().notebook().getContext().tags().apply("browserHostName") &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; works in an All-Purpose cluster in an interactive way, this key does not exist when running in a Job cluster context.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 14:10:40 GMT</pubDate>
    <dc:creator>Deepak_Bhutada</dc:creator>
    <dc:date>2021-10-29T14:10:40Z</dc:date>
    <item>
      <title>Retrieve workspace instance name on E2 architecture (multi-tenant) in notebook running on job cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/11998#M6871</link>
      <description>&lt;P&gt;I have a databricks job on E2 architecture in which I want to retrieve the workspace instance name within a notebook running in a Job cluster context so that I can use it further in my use case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While the call &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.notebook.entry_point.getDbutils().notebook().getContext().tags().apply("browserHostName") &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; works in an All-Purpose cluster in an interactive way, this key does not exist when running in a Job cluster context.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 14:10:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/11998#M6871</guid>
      <dc:creator>Deepak_Bhutada</dc:creator>
      <dc:date>2021-10-29T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve workspace instance name on E2 architecture (multi-tenant) in notebook running on job cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/11999#M6872</link>
      <description>&lt;P&gt;it is not possible to get the workspace URL/Shard name from MT/E2 because we don't inject the user-visible URL, but the driver reachable one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as a workaround to get the shardname in our job, we can write a file with our shard name in a particular dbfs location and read it inside the job as shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.put("/FileStore/Deepak-test/ShardName.txt", "https://cse2.cloud.databricks.com/")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When you will run a job, you can read that file and get the shard name from there.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.head("/FileStore/Deepak-test/ShardName.txt")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;B&gt;Or&lt;/B&gt; you can create a dictionary as well which you can use to get shardname inside a job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WORKSPACES = {
"111": "workspace1",
"222": "workspace1"
}
&amp;nbsp;
org_id = get_notebook_context().tags().apply("orgId")
&amp;nbsp;
print(f"https://{WORKSPACES[org_id]}.cloud.databricks.com")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 14:43:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/11999#M6872</guid>
      <dc:creator>Deepak_Bhutada</dc:creator>
      <dc:date>2021-10-29T14:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve workspace instance name on E2 architecture (multi-tenant) in notebook running on job cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/12000#M6873</link>
      <description>&lt;P&gt;Actually is anybody aware of a fix for Azure Databricks, too?  (My use case is to send out status messages from a batch run which includes a link to the job cluster page or run page to allow operators to click for details.)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 08:02:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/12000#M6873</guid>
      <dc:creator>Thomas_B_</dc:creator>
      <dc:date>2022-04-28T08:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve workspace instance name on E2 architecture (multi-tenant) in notebook running on job cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/12001#M6874</link>
      <description>&lt;P&gt;Found workaround for Azure Databricks question above: dbutils.notebook.getContext().apiUrl will return the regional URI, but this forwards to the workspace-specific one if the workspace id is specified with o=.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 07:26:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-workspace-instance-name-on-e2-architecture-multi-tenant/m-p/12001#M6874</guid>
      <dc:creator>Thomas_B_</dc:creator>
      <dc:date>2022-05-25T07:26:21Z</dc:date>
    </item>
  </channel>
</rss>

