<?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 Azure databricks streamlit app unity catalog access in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/azure-databricks-streamlit-app-unity-catalog-access/m-p/142352#M51926</link>
    <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I am developing a Databricks app. I will use Databricks asset bundles for deployment.&lt;/P&gt;&lt;P&gt;How can I connect Databricks streamlit app into Databricks unity catalog?&lt;/P&gt;&lt;P&gt;Where should I define the credentials? (Databricks host for dev, qa and prod environments, users, passwords etc)&lt;/P&gt;&lt;P&gt;Which compute should I choose? (SQL Warehouse, All Purpose Compute etc)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Dec 2025 12:21:57 GMT</pubDate>
    <dc:creator>ndw</dc:creator>
    <dc:date>2025-12-22T12:21:57Z</dc:date>
    <item>
      <title>Azure databricks streamlit app unity catalog access</title>
      <link>https://community.databricks.com/t5/data-engineering/azure-databricks-streamlit-app-unity-catalog-access/m-p/142352#M51926</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I am developing a Databricks app. I will use Databricks asset bundles for deployment.&lt;/P&gt;&lt;P&gt;How can I connect Databricks streamlit app into Databricks unity catalog?&lt;/P&gt;&lt;P&gt;Where should I define the credentials? (Databricks host for dev, qa and prod environments, users, passwords etc)&lt;/P&gt;&lt;P&gt;Which compute should I choose? (SQL Warehouse, All Purpose Compute etc)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2025 12:21:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/azure-databricks-streamlit-app-unity-catalog-access/m-p/142352#M51926</guid>
      <dc:creator>ndw</dc:creator>
      <dc:date>2025-12-22T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Azure databricks streamlit app unity catalog access</title>
      <link>https://community.databricks.com/t5/data-engineering/azure-databricks-streamlit-app-unity-catalog-access/m-p/142358#M51930</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a starter you may want to try deploying the streamlit starter app from the app UI, this will show you the pattern to connect and pull data into your streamlit app. The following then gives some best practise guidelines on your questions:&lt;/P&gt;
&lt;H3 class="_9k2iva0 p8i6j0c _1ibi0s312 heading3 _9k2iva1"&gt;1. &lt;STRONG&gt;Unity Catalog and Streamlit App Integration&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P class="p8i6j01 paragraph"&gt;&lt;STRONG&gt;Streamlit apps run as Databricks Apps within your workspace.&lt;/STRONG&gt; To enable data access via Unity Catalog:&lt;/P&gt;
&lt;UL class="p8i6j07 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;Grant your app access to Unity Catalog assets, such as tables and volumes, by referencing them in your asset bundle (YAML) as &lt;CODE class="p8i6j0f"&gt;uc_securable&lt;/CODE&gt;, &lt;CODE class="p8i6j0f"&gt;registered_model&lt;/CODE&gt;, &lt;CODE class="p8i6j0f"&gt;schema&lt;/CODE&gt;, or &lt;CODE class="p8i6j0f"&gt;volume&lt;/CODE&gt; types.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;For tabular data access, you must use a Unity Catalog-enabled compute (more below).&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;If you need to access data in Unity Catalog Volumes (e.g., for file reads/writes), you can include a volume resource and grant the app read/write permission as needed in your bundle.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="p8i6j01 paragraph"&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; As of late 2025, mounting UC volumes directly in Streamlit apps via &lt;CODE class="p8i6j0f"&gt;/Volumes&lt;/CODE&gt; is not supported ("Can I mount a Unity Catalog volume in my app? Not today.") but you can use SDK or direct APIs to interact with UC assets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;H3 class="_9k2iva0 p8i6j0c _1ibi0s312 heading3 _9k2iva1"&gt;2. &lt;STRONG&gt;Credential and Environment Management&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P class="p8i6j01 paragraph"&gt;Databricks Asset Bundles support robust environment (dev/qa/prod) isolation and credential management via configuration files and best practices:&lt;/P&gt;
&lt;H4 class="_9k2iva0 p8i6j0c _1ibi0s312 heading4 _9k2iva1"&gt;a) &lt;STRONG&gt;Environment Separation with Targets&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL class="p8i6j07 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;Define separate targets in your &lt;CODE class="p8i6j0f"&gt;databricks.yml&lt;/CODE&gt; bundle for dev, qa, and prod. Each target can have its own workspace (host), compute resources, and variables.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;For each target, you typically specify the corresponding Databricks workspace URL and authentication method (see below for securing credentials).&lt;/LI&gt;
&lt;/UL&gt;
&lt;H4 class="_9k2iva0 p8i6j0c _1ibi0s312 heading4 _9k2iva1"&gt;b) &lt;STRONG&gt;Authentication: Where to Place Credentials&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL class="p8i6j07 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;DO NOT hardcode secrets or credentials in the bundle YAML.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;Use the workspace/profile mapping in the target to reference Databricks CLI profiles (&lt;CODE class="p8i6j0f"&gt;.databrickscfg&lt;/CODE&gt;), which are stored securely in your deployment environment (e.g., your CI/CD system). The CLI then picks up the appropriate host, token, client_id, etc., from the matching profile.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;For sensitive values like personal access tokens or client secrets, use environment variables (e.g., &lt;CODE class="p8i6j0f"&gt;DATABRICKS_TOKEN&lt;/CODE&gt;, &lt;CODE class="p8i6j0f"&gt;DATABRICKS_CLIENT_SECRET&lt;/CODE&gt;) set in your CI/CD environment or local dev machine, not in code or bundle files.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;You can define additional custom variables in your bundle for parameters (e.g., database names, resource paths), but never for secrets.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;For secret management within Databricks itself (e.g., API keys to call external services), define secret scopes in your bundle and reference them in your app configuration. Secret scopes can be workspace-native or, on Azure, backed by Key Vault.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H5 class="_9k2iva0 p8i6j0c _1ibi0s312 heading5 _9k2iva1"&gt;Example Target Configuration&lt;/H5&gt;
&lt;DIV class="l8rrz21 _1ibi0s3cl" data-ui-element="code-block-container"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-yaml p8i6j0e hljs language-yaml _12n1b832"&gt;&lt;SPAN class="hljs-attr"&gt;targets:&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;dev:&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;workspace:&lt;/SPAN&gt;
      &lt;SPAN class="hljs-attr"&gt;host:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;https://&amp;lt;dev-workspace-url&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;qa:&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;workspace:&lt;/SPAN&gt;
      &lt;SPAN class="hljs-attr"&gt;host:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;https://&amp;lt;qa-workspace-url&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;prod:&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;workspace:&lt;/SPAN&gt;
      &lt;SPAN class="hljs-attr"&gt;host:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;https://&amp;lt;prod-workspace-url&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="l8rrz23 _1ibi0s32y _1ibi0s3cm _1ibi0s3ay _1ibi0s3bo"&gt;
&lt;DIV class="l8rrz25 _1ibi0s3cj"&gt;yaml&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="p8i6j01 paragraph"&gt;Your CI/CD pipeline (e.g., GitHub Actions, Azure DevOps) should set up the corresponding &lt;CODE class="p8i6j0f"&gt;.databrickscfg&lt;/CODE&gt; files or environment variables for each environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;H3 class="_9k2iva0 p8i6j0c _1ibi0s312 heading3 _9k2iva1"&gt;3. &lt;STRONG&gt;Compute Selection: SQL Warehouse vs. All Purpose Compute&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P class="p8i6j01 paragraph"&gt;The right compute depends on your workload:&lt;/P&gt;
&lt;H4 class="_9k2iva0 p8i6j0c _1ibi0s312 heading4 _9k2iva1"&gt;a) &lt;STRONG&gt;For Streamlit Apps Accessing Unity Catalog&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL class="p8i6j07 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;If your app primarily executes interactive SQL queries or serves BI-style workloads:&lt;/STRONG&gt; Use a Databricks SQL Warehouse as the compute assigned in your asset bundle app resource. SQL Warehouses are optimized for concurrent, low-latency SQL workloads, and include serverless options for instant startup and cost efficiency.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;For workloads that require full Spark (PySpark, DataFrames, ML/AI workloads, or custom Python libraries):&lt;/STRONG&gt; Use All Purpose Compute (cluster). If using clusters, make sure to enable Unity Catalog on the cluster with the proper access mode (Standard or Dedicated), as Unity Catalog tables require UC-enabled compute.
&lt;UL class="p8i6j08 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;All Purpose Compute is typically used for development and interactive analytic workloads.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;For production ETL/batch jobs, use Jobs Compute clusters.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;For accessing Unity Catalog volumes, models, or data lineage features:&lt;/STRONG&gt; Both SQL Warehouses and UC-enabled clusters are supported as long as the relevant permissions and data governance modes are set.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H5 class="_9k2iva0 p8i6j0c _1ibi0s312 heading5 _9k2iva1"&gt;Example Asset Bundle App Resource (for SQL Warehouse)&lt;/H5&gt;
&lt;DIV class="l8rrz21 _1ibi0s3cl" data-ui-element="code-block-container"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-yaml p8i6j0e hljs language-yaml _12n1b832"&gt;&lt;SPAN class="hljs-attr"&gt;apps:&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;my_streamlit_app:&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;source_code_path:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;./app&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;resources:&lt;/SPAN&gt;
      &lt;SPAN class="hljs-bullet"&gt;-&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;name:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;prod-sqlwh&lt;/SPAN&gt;
        &lt;SPAN class="hljs-attr"&gt;sql_warehouse:&lt;/SPAN&gt;
          &lt;SPAN class="hljs-attr"&gt;id:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;${var.sql_warehouse_id}&lt;/SPAN&gt;
          &lt;SPAN class="hljs-attr"&gt;permission:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;CAN_USE&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="l8rrz23 _1ibi0s32y _1ibi0s3cm _1ibi0s3ay _1ibi0s3bo"&gt;
&lt;DIV class="l8rrz25 _1ibi0s3cj"&gt;yaml&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="p8i6j01 paragraph"&gt;You can similarly define clusters (All Purpose Compute) and assign them via &lt;CODE class="p8i6j0f"&gt;cluster_id&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;H3 class="_9k2iva0 p8i6j0c _1ibi0s312 heading3 _9k2iva1"&gt;4. &lt;STRONG&gt;Best Practices Summary&lt;/STRONG&gt;&lt;/H3&gt;
&lt;UL class="p8i6j07 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;Separate environments:&lt;/STRONG&gt; Use &lt;CODE class="p8i6j0f"&gt;targets&lt;/CODE&gt; for dev, qa, prod; keep workspaces and catalogs isolated.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;Credential hygiene:&lt;/STRONG&gt; Rely on CLI profiles and CI/CD environment variables for host/auth; never commit secrets. Use secret scopes for app-level secrets.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;Compute choice:&lt;/STRONG&gt;
&lt;UL class="p8i6j08 p8i6j02"&gt;
&lt;LI class="p8i6j0a"&gt;SQL Warehouse: Best for BI, analytics, and concurrent SQL (especially serverless).&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;All Purpose Compute: For interactive, Spark-native, or custom Python workloads.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;Streamlit-Unity Catalog integration:&lt;/STRONG&gt; Reference Unity Catalog resources in your app bundle; ensure the compute is UC-enabled.&lt;/LI&gt;
&lt;LI class="p8i6j0a"&gt;&lt;STRONG&gt;Manage permissions strictly:&lt;/STRONG&gt; Principle of least privilege in Unity Catalog, assign necessary grants to the app or responsible groups.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 22 Dec 2025 13:57:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/azure-databricks-streamlit-app-unity-catalog-access/m-p/142358#M51930</guid>
      <dc:creator>emma_s</dc:creator>
      <dc:date>2025-12-22T13:57:50Z</dc:date>
    </item>
  </channel>
</rss>

