<?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: Is there a way to programatically retrieve a workspace name ? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29601#M21324</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot 2022-02-04 at 08.54.25"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2132i970ACCBE0E2528D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-02-04 at 08.54.25" alt="Screenshot 2022-02-04 at 08.54.25" /&gt;&lt;/span&gt;Thanks Navya! But this doesn't work for me on a High Concurrency cluster. It seems that toJson() isn't whitelisted.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2022 07:54:51 GMT</pubDate>
    <dc:creator>AmarK</dc:creator>
    <dc:date>2022-02-04T07:54:51Z</dc:date>
    <item>
      <title>Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29599#M21322</link>
      <description>&lt;P&gt;Is there a spark command in databricks that will tell me what databricks workspace I am using? I’d like to parameterise my code so that I can update delta lake file paths automatically depending on the workspace (i.e. it picks up the dev workspace name when in dev and will pick up the prod workspace name in prod). Is this possible?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 23:10:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29599#M21322</guid>
      <dc:creator>AmarK</dc:creator>
      <dc:date>2022-02-03T23:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29600#M21323</link>
      <description>&lt;P&gt;You may run the below in a notebook within the workspace: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.entry_point.getDbutils().notebook().getContext().toJson()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output contains:&amp;nbsp;&lt;/P&gt;&lt;P&gt;browserHostName - is the workspace name&lt;/P&gt;&lt;P&gt;orgId - is the workspaceID&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 04:26:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29600#M21323</guid>
      <dc:creator>Navya_R</dc:creator>
      <dc:date>2022-02-04T04:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29601#M21324</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot 2022-02-04 at 08.54.25"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2132i970ACCBE0E2528D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-02-04 at 08.54.25" alt="Screenshot 2022-02-04 at 08.54.25" /&gt;&lt;/span&gt;Thanks Navya! But this doesn't work for me on a High Concurrency cluster. It seems that toJson() isn't whitelisted.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 07:54:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/29601#M21324</guid>
      <dc:creator>AmarK</dc:creator>
      <dc:date>2022-02-04T07:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128499#M48261</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; databricks.sdk &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; WorkspaceClient&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;workspace_client = WorkspaceClient()&lt;/DIV&gt;&lt;DIV&gt;workspace_hostname = workspace_client.config.host&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Aug 2025 11:34:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128499#M48261</guid>
      <dc:creator>mehdi_lamrani</dc:creator>
      <dc:date>2025-08-15T11:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128504#M48264</link>
      <description>&lt;P&gt;How does it even make sense? Did you even see how old the post is? It's confusing! What made you reply to this post, wondering!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 12:19:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128504#M48264</guid>
      <dc:creator>SebastianRowan</dc:creator>
      <dc:date>2025-08-15T12:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to programatically retrieve a workspace name ?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128515#M48268</link>
      <description>&lt;P&gt;To programmatically retrieve the Databricks workspace name from within a notebook, you can use Spark configuration or the notebook context. One method is to read the workspace URL using spark.conf.get("spark.databricks.workspaceUrl") and then extract the instance name—for example, by splitting at the first period. Alternatively, you can access the notebook context with dbutils.notebook.entry_point.getDbutils().notebook().getContext().browserHostName().toString() (or via the equivalent JSON tags), which provides the hostname corresponding to the workspace. Both approaches give you a way to dynamically capture and use the workspace identifier in your code.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 13:23:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-programatically-retrieve-a-workspace-name/m-p/128515#M48268</guid>
      <dc:creator>WiliamRosa</dc:creator>
      <dc:date>2025-08-15T13:23:53Z</dc:date>
    </item>
  </channel>
</rss>

