<?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: Connecting to Snowflake via Workload Identity Federation in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170109#M56232</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/261620"&gt;@SKiruthiga&lt;/a&gt;&amp;nbsp;You can use Lakehouse Federation using Microsoft Entra ID in Machine to Machine mode if feasible.&amp;nbsp;You can shift the authentication part to Unity Catalog. To configure this flow, you can register an application in Entra ID. On the Snowflake side, you can create an External OAuth security integration tied to that Entra app. You finally create a Unity Catalog foreign connection mapping to Snowflake.&lt;/P&gt;&lt;P&gt;Databricks handles the token exchange automatically in the background. It technically replaces the native Snowflake credentials with an Entra ID client secret and eliminates long lived Snowflake tokens for Spark jobs and manual credential management. Routing it through Lakehouse Federation gives you centralized, governed and SQL based access to Snowflake data directly inside Unity Catalog. More details &lt;A href="https://docs.databricks.com/aws/en/query-federation/snowflake-entra/" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2026 05:47:39 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-09-29T05:47:39Z</dc:date>
    <item>
      <title>Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170070#M56222</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I appreciate your time!! We currently use username and password authentication to connect to Snowflake from a Databricks Spark job. We are exploring Workload Identity Federation as an alternative so that we can eliminate long-lived Snowflake credentials.&lt;/P&gt;&lt;P&gt;However, it appears that the Snowflake Spark connector may not currently support Azure Workload Identity Federation for Spark DataFrame read/write operations.&lt;/P&gt;&lt;P&gt;Has anyone successfully configured this authentication flow from Azure Databricks to Snowflake? If so, could you please share the supported connector version, required Databricks configuration, and Snowflake-side setup?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Kiruthiga&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2026 16:29:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170070#M56222</guid>
      <dc:creator>SKiruthiga</dc:creator>
      <dc:date>2026-09-28T16:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170077#M56226</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/261620"&gt;@SKiruthiga&lt;/a&gt;, I took a look at both internal and external documentation and here is what I found.&lt;/P&gt;
&lt;P&gt;Short version: the Snowflake Connector for Spark does support workload identity federation, starting with version 3.1.7 (certified against JDBC 3.28.0). The harder question is whether your Azure Databricks cluster can hand the connector a usable Azure identity. Those are two different things.&lt;/P&gt;
&lt;P&gt;The connector options look like this, and the same options work for &lt;CODE&gt;df.write&lt;/CODE&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;sfOptions = {
    "sfURL": "&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com",
    "sfUser": "&amp;lt;snowflake_service_user&amp;gt;",
    "sfAuthenticator": "WORKLOAD_IDENTITY",
    "sfWorkloadIdentityProvider": "AZURE",
    "sfDatabase": "&amp;lt;database&amp;gt;",
    "sfSchema": "&amp;lt;schema&amp;gt;",
    "sfWarehouse": "&amp;lt;warehouse&amp;gt;"
}

df = spark.read.format("snowflake").options(**sfOptions).option("dbtable", "&amp;lt;table&amp;gt;").load()
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On the Snowflake side, create a service user whose identity matches the Azure identity the job runs as, then grant it only the role and privileges it needs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;CREATE USER &amp;lt;snowflake_service_user&amp;gt;
  TYPE = SERVICE
  WORKLOAD_IDENTITY = (
    TYPE = AZURE
    ISSUER = 'https://login.microsoftonline.com/&amp;lt;tenant_id&amp;gt;/v2.0'
    SUBJECT = '&amp;lt;managed_identity_object_id&amp;gt;'
  );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now a caveat. &lt;CODE&gt;AZURE&lt;/CODE&gt; mode expects to fetch a token from the Azure Instance Metadata Service for a managed identity attached to the VM. On Databricks classic compute those VMs sit in the Databricks-managed resource group, so you can't attach your own identity to them, and serverless has no VM you control at all. I don't see anything public that guarantees this endpoint is available to the connector, and I'd expect it to fail. If it does, tweaking the two Spark options won't fix it.&lt;/P&gt;
&lt;P&gt;The route I'd try instead is &lt;CODE&gt;OIDC&lt;/CODE&gt; mode with a Unity Catalog service credential supplying the token. A service credential wraps a managed identity (through an Access Connector for Azure Databricks) and gives your code a TokenCredential. Rough shape:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Tenant admin, one time: consent to Snowflake's multi-tenant Entra app (link in the Snowflake WIF doc). That app is the audience Snowflake expects on Azure tokens.&lt;/LI&gt;
&lt;LI&gt;Azure: create an Access Connector for Azure Databricks and note its managed identity's Object ID.&lt;/LI&gt;
&lt;LI&gt;Databricks: create a UC service credential on that access connector and grant ACCESS to the job's principal.&lt;/LI&gt;
&lt;LI&gt;In the job, request a token and pass it through:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;cred = dbutils.credentials.getServiceCredentialsProvider("snowflake-wif")
token = cred.get_token("api://fd3f753b-eed3-462c-b6a7-a4b5bb650aad/.default").token

sfOptions["sfWorkloadIdentityProvider"] = "OIDC"
sfOptions["sfToken"] = token
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;OL start="5"&gt;
&lt;LI&gt;Snowflake: decode one token first (the WIF doc has a jq one-liner) and copy the exact &lt;CODE&gt;iss&lt;/CODE&gt; and &lt;CODE&gt;sub&lt;/CODE&gt; claims into &lt;CODE&gt;ISSUER&lt;/CODE&gt; and &lt;CODE&gt;SUBJECT&lt;/CODE&gt;. Managed identity tokens sometimes carry the v1 issuer (&lt;CODE&gt;sts.windows.net/...&lt;/CODE&gt;) rather than v2, and Snowflake matches exactly. If you use &lt;CODE&gt;TYPE = OIDC&lt;/CODE&gt; on the user instead of &lt;CODE&gt;TYPE = AZURE&lt;/CODE&gt;, set &lt;CODE&gt;OIDC_AUDIENCE_LIST&lt;/CODE&gt; to the token's audience too.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I haven't run the OIDC plus service credential combination end to end, so treat it as the approach I'd try rather than a confirmed recipe. And check which connector version your Databricks Runtime bundles (&lt;CODE&gt;ls /databricks/jars | grep -i snowflake&lt;/CODE&gt; on the cluster). If it's older than 3.1.7 you'll need to attach the newer connector and JDBC jars and confirm they win over the bundled ones.&lt;/P&gt;
&lt;P&gt;A few smaller notes. Entra tokens last about an hour; that's fine for a batch job that fetches a fresh one per run, but a long-running streaming job needs a refresh plan. Don't confuse Snowflake WIF with Databricks OAuth token federation, which is the reverse direction (external workloads authenticating into Databricks) and a separate trust setup. And whichever path you pick, validate with a &lt;CODE&gt;SELECT 1&lt;/CODE&gt; read and a tiny write before migrating the real job.&lt;/P&gt;
&lt;P&gt;If WIF is a dead end in your setup, Snowflake External OAuth with a short-lived Entra token (&lt;CODE&gt;sfAuthenticator = oauth&lt;/CODE&gt;) is the fallback. It needs a Snowflake security integration and its own token refresh handling, but it still gets you off stored passwords. If your need is mostly reads, Lakehouse Federation's Snowflake connection with OAuth keeps auth out of your job code entirely.&lt;/P&gt;
&lt;P&gt;References:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Snowflake WIF overview, including Azure setup and supported drivers: &lt;A href="https://docs.snowflake.com/en/user-guide/workload-identity-federation" target="_blank"&gt;https://docs.snowflake.com/en/user-guide/workload-identity-federation&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Snowflake Spark connector options: &lt;A href="https://docs.snowflake.com/en/user-guide/spark-connector-use" target="_blank"&gt;https://docs.snowflake.com/en/user-guide/spark-connector-use&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Databricks: read and write Snowflake data: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/connect/external-systems/snowflake" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/connect/external-systems/snowflake&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Create UC service credentials on Azure: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/connect/unity-catalog/cloud-services/service-credentials" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/connect/unity-catalog/cloud-services/service-credentials&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use service credentials from code: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/connect/unity-catalog/cloud-services/use-service-credentials" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/connect/unity-catalog/cloud-services/use-service-credentials&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you get it working, please post back with the &lt;CODE&gt;ISSUER&lt;/CODE&gt; and &lt;CODE&gt;SUBJECT&lt;/CODE&gt; shape you ended up with. It'd save the next person a lot of trial and error.&lt;/P&gt;
&lt;P&gt;Regards, Louis.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2026 16:52:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170077#M56226</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2026-09-28T16:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170093#M56229</link>
      <description>&lt;P&gt;Thank you Louis, surely will try it out and update you!!&lt;/P&gt;&lt;P&gt;Kiruthiga&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2026 19:22:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170093#M56229</guid>
      <dc:creator>SKiruthiga</dc:creator>
      <dc:date>2026-09-28T19:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170109#M56232</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/261620"&gt;@SKiruthiga&lt;/a&gt;&amp;nbsp;You can use Lakehouse Federation using Microsoft Entra ID in Machine to Machine mode if feasible.&amp;nbsp;You can shift the authentication part to Unity Catalog. To configure this flow, you can register an application in Entra ID. On the Snowflake side, you can create an External OAuth security integration tied to that Entra app. You finally create a Unity Catalog foreign connection mapping to Snowflake.&lt;/P&gt;&lt;P&gt;Databricks handles the token exchange automatically in the background. It technically replaces the native Snowflake credentials with an Entra ID client secret and eliminates long lived Snowflake tokens for Spark jobs and manual credential management. Routing it through Lakehouse Federation gives you centralized, governed and SQL based access to Snowflake data directly inside Unity Catalog. More details &lt;A href="https://docs.databricks.com/aws/en/query-federation/snowflake-entra/" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2026 05:47:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170109#M56232</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-09-29T05:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170131#M56238</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/261620"&gt;@SKiruthiga&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m using Snowflake through a Unity Catalog federated connection with PEM private-key authentication. That keeps credentials out of the Spark code and lets Snowflake exposed through a foreign catalog.&lt;/P&gt;&lt;P&gt;It definitely is not the same as Snowflake workload identity federation, but if the main requirement is secure read/query access from Databricks without username/password in the job, it may be worth considering. Lakehouse Federation also supports predicate pushdown to snowflake which helped us pull only the data required.&lt;/P&gt;&lt;P&gt;One limitation is that Federated Connection is primarily for querying/read access, so it won’t replace a Spark connector workflow if you also need to write back to Snowflake. &lt;A href="https://docs.databricks.com/aws/en/query-federation/snowflake-pem" target="_self"&gt;Docs&lt;/A&gt; for reference.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2026 09:35:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170131#M56238</guid>
      <dc:creator>data_pulse</dc:creator>
      <dc:date>2026-09-29T09:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake via Workload Identity Federation</title>
      <link>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170133#M56239</link>
      <description>&lt;P&gt;Great topic—WIF can simplify Snowflake authentication quite a bit. Curious if anyone has a clean setup that works reliably with Databricks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2026 09:36:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/connecting-to-snowflake-via-workload-identity-federation/m-p/170133#M56239</guid>
      <dc:creator>ThiamLee</dc:creator>
      <dc:date>2026-09-29T09:36:30Z</dc:date>
    </item>
  </channel>
</rss>

