Louis_Frolio
Databricks Employee
Databricks Employee

Greetings @pxs132, I did some digging and here is what I found.

@Kashif_Inamdar's answer matches the current docs: secret() runs with the caller's permissions, and a Unity Catalog Python UDF with the SECRETS clause is the supported fix. On your four follow-ups:

  • Azure RBAC. Yes. Your read on workspace secret scopes is right (Vault access policy only). External secrets authenticate through a Unity Catalog service credential, and the docs have you grant its managed identity or service principal the Key Vault Secrets User role. An access policy with get and list works too.
  • GA and production use. External secrets are still in Beta, and no GA date has been published. Beta means not intended for production and no SLA, so I wouldn't put an enterprise masking key behind it yet. Databricks-managed Unity Catalog secrets went GA on August 3, 2026, and they use the same SECRETS clause and permission model. Start there and move to a Key Vault-backed schema at GA. A schema holds one type or the other, never both, so plan the switch around that.
  • SQL wrapper for ABAC masks. Documented and supported. The Python UDF needs environment_version 6 or above, and it runs on serverless compute, pro or serverless SQL warehouses, or Databricks Runtime 19 and above in standard access mode. On dedicated access mode the mask still works, because Databricks enforces it on serverless. Keep DETERMINISTIC on the Python UDF so filters can still push down. With Key Vault-backed secrets, each read adds latency. I haven't measured that inside a mask, so benchmark on at least a million rows first.
  • Secrets in native SQL UDFs. Not available today. The SECRETS clause covers Python and Scala UDFs only, and I'm not aware of a public roadmap item, so raise it with your account team. To trim the Python overhead, put exempt users in the policy's EXCEPT clause so the UDF never runs for them.

Plain and simple: the pattern works in production today with a Databricks-managed secret, and Key Vault backing is a Beta decision for now.

References:

If you found this answer helpful please check off "Accept as Solutions" so that others can have confidence in the answer.

Regards, Louis.

View solution in original post