The Simplest Way to Make Cloud Run and Databricks ML Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use cloud run and databricks ml to serve models to web apps fast. Cloud Run hosts the web app, while Databricks ML trains and runs the models. This pair lets developers build small web services that scale up and down fast. Meanwhile, data scientists keep their model work inside one shared data workspace. When both tools work well together, teams ship features much faster. Still, linking a Google Cloud web app to a data workspace takes careful setup. You must manage identity, permissions,

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use cloud run and databricks ml to serve models to web apps fast. Cloud Run hosts the web app, while Databricks ML trains and runs the models.

This pair lets developers build small web services that scale up and down fast. Meanwhile, data scientists keep their model work inside one shared data workspace. When both tools work well together, teams ship features much faster. Still, linking a Google Cloud web app to a data workspace takes careful setup. You must manage identity, permissions, and network paths across both platforms.

How cloud run and databricks ml share data and roles

First, a user sends a web request to the Cloud Run app. The app checks the input and prepares a call to the model endpoint. Next, the app must prove its identity to the Databricks workspace. Teams should use service accounts and workload identity federation for this step. This setup lets Google Cloud trade its identity token for a workspace token.

Once logged in, the app sends input features to the model serving endpoint. Databricks ML runs the model and sends the prediction back to the app. Then, the Cloud Run service formats the answer and returns it to the user. Every call must use encrypted network paths between the two cloud platforms. You should also map each app service account to a specific workspace role. That role should only have permission to query the specific model endpoint.

Common risks with tokens and broad roles

Many teams take shortcuts when they first link these two platforms together. A common mistake is putting a long-lived personal token inside the app settings. If that token leaks, an attacker can read or delete training data. Shared tokens also make it hard to see which app made a call. All requests look the same inside your workspace audit logs.

Another common risk comes from giving the web app too many permissions. A web app does not need rights to edit notebooks or start clusters. It only needs permission to send data to one model endpoint. Teams also forget to check what sensitive data goes into model prompts. Customer emails, phone numbers, card numbers, or national IDs might pass through the app. Masking rewrites matched fields in results so sensitive strings stay safe during checks.

End-to-End Encryption + ML Engineer Infrastructure Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to lock down network paths and audit logs

Start by removing all static keys from your Cloud Run app settings. Set up short-lived tokens tied to a single Google Cloud service account. Give each web service its own unique identity in both platforms. This step makes every single model call clear in your system logs. You will always know which service sent a request and when it happened.

Next, limit network traffic between your web apps and your model endpoints. Use private network links or strict IP allowlists to block outside traffic. Also, set up clear rules for what data can flow between the tools. Check all incoming and outgoing payloads for sensitive items like card numbers or emails. Finally, store all call logs in one central place for your security team. Good logs help you spot slow queries, bad inputs, or strange access patterns fast.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How should Cloud Run log in to Databricks ML?

Use a dedicated service account with workload identity instead of static keys. This method trades short-lived cloud tokens so you never store long-lived secrets.

What permissions does the Cloud Run app need in the workspace?

Give the app role permission to query only the single model endpoint. Never grant workspace admin rights or cluster creation rights to a web app.

How can teams protect sensitive data sent to model endpoints?

Apply data masking to rewrite emails, phone numbers, card numbers, or national IDs. This keeps sensitive strings out of prompts and model output logs.

The query runs. The emails stay hidden.