cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Genie Hub
Explore technical articles, practical guides, best practices, and real-world use cases to help you get the most out of Databricks Genie. Learn from the Databricks team, MVPs, and community experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Pattern: Sharing Databricks output with an AKS app through an external volume and managed identity

Amar_Naik
New Contributor II

Scenario
 A transaction app runs on AKS. It is the only component with a connection to MongoDB Atlas. Databricks processes the data, and the app has to pick up the results and write them back to Atlas. The requirements are no PATs, no CLI, no Databricks API calls from the pod, and no Databricks access to the production database.

Pattern

  1. Databricks writes to an external volume.
    • An Access Connector (managed identity) has Storage Blob Data Contributor on a dedicated ADLS Gen2 export container.
    • A Unity Catalog storage credential, external location, and external volume sit on top of it.
    • Jobs write Parquet or Delta to /Volumes/<cat>/<schema>/<vol>/... and write a manifest file last.
  2. AKS mounts the same container as blob storage.
    • The Azure Blob CSI driver mounts the export container into the pod as a read-only volume.
    • Authentication uses a managed identity with Storage Blob Data Reader on that container only. No account keys or SAS tokens are stored in the cluster.
    • The app reads the files as a normal local path, for example /mnt/exports/<batch_id>/.... No Azure SDK is needed in the app code.
  3. The app job upserts into Atlas.

Why this works well

  • Only the app touches Atlas.
  • No secrets in either direction.
  • Databricks and the app are decoupled, and every batch can be replayed from storage.

Trade-offs

  • Unity Catalog does not govern the AKS reads. Azure RBAC does. A dedicated export container, least-privilege roles, and storage diagnostic logs cover the audit side.
  • The pattern suits batch and micro-batch. Low-latency needs call for Event Hubs or Kafka.
  • Many consumers across teams call for Delta Sharing instead.

Open points

How others handle the governance gap on reads outside Unity Catalog.

1 REPLY 1

DoTA
Honored Contributor

This is close to what I'd do too. On the open point about reads outside Unity Catalog: I don't think there's a way to get UC to govern them, so I'd lean on the storage side. Private endpoint or firewall on the export account, the reader identity scoped to just that container, and diagnostic logs going to a Log Analytics workspace. Then "who read which batch" is a query against those logs, and you can join it to the batch_id in your manifest.

Two small things on the mount. The AKS docs example for the blob CSI storage class sets attribute and negative caching of around 120 seconds, so if the app polls for the manifest it may not see it straight away. I'm not sure what the defaults are on your cluster, worth checking the mount options. And if you ever write Delta instead of Parquet into the batch folder, reading it as plain files from the pod will also pick up old data files that are no longer in the current table version, so you'd get duplicates until VACUUM runs. Parquet per batch_id is the safer thing to hand over.