/databricks-skills:cookbook-external-servicesfrom databricks-skills
Connects Databricks Apps to external APIs (GitHub, Jira, Slack) via Unity Catalog HTTP connections and retrieves Databricks secrets. Includes code examples for Dash, Streamlit, and Reflex apps.
Ships in databricks-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Connect to external APIs using Unity Catalog HTTP connections and retrieve Databricks secrets for secure credential management.
Use UC-managed HTTP connections for governed access to external services (GitHub, Jira, Slack, or any MCP/non-MCP server).
Uses the end user's identity to call the external service:
Dash:
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod
from flask import request
token = request.headers.get("x-forwarded-access-token")
w = WorkspaceClient(token=token, auth_type="pat")
response = w.serving_endpoints.http_request(
conn="github_u2m",
method=ExternalFunctionRequestHttpMethod.GET,
path="/user",
headers={"Accept": "application/vnd.github+json"},
)
print(response.json())
Streamlit:
import streamlit as st
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod
token = st.context.headers.get("X-Forwarded-Access-Token")
w = WorkspaceClient(token=token, auth_type="pat")
response = w.serving_endpoints.http_request(
conn="github_u2m",
method=ExternalFunctionRequestHttpMethod.GET,
path="/user",
headers={"Accept": "application/vnd.github+json"},
)
st.json(response.json())
Reflex:
import reflex as rx
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod
class ExternalConnectionsState(rx.State):
response_data: str = ""
@rx.event
async def run(self):
headers = self.router.headers
token = getattr(headers, "x_forwarded_access_token", "")
w = WorkspaceClient(token=token, auth_type="pat")
response = w.serving_endpoints.http_request(
conn="github_u2m",
method=ExternalFunctionRequestHttpMethod.GET,
path="/user",
headers={"Accept": "application/vnd.github+json"},
)
self.response_data = str(response.json())
Uses the app's service principal identity:
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod
w = WorkspaceClient()
response = w.serving_endpoints.http_request(
conn="github_connection",
method=ExternalFunctionRequestHttpMethod.GET,
path="/traffic/views",
headers={"Accept": "application/vnd.github+json"},
)
Access Databricks secrets for API keys and credentials:
import base64
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
def get_secret(scope: str, key: str) -> str:
secret_response = w.secrets.get_secret(scope=scope, key=key)
return base64.b64decode(secret_response.value).decode("utf-8")
api_key = get_secret("my_scope", "api_key")
| Recipe | Resources |
|---|---|
| HTTP connections | Unity Catalog HTTP Connection |
| Secrets | Secret scope |
| Recipe | Permissions |
|---|---|
| HTTP connections | USE CONNECTION on the HTTP Connection |
| HTTP connections (OBO) | Additionally configure User authorization scopes |
| Secrets | CAN READ on the secret scope |
databricks-sdk
Plus your framework package (dash, streamlit, or reflex).
x-forwarded-access-token) are only available when deployed to Databricks Apps, not locallybase64.b64decode()mcp-session-id header for subsequent requestsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
databricks, external-apis, unity-catalog, secrets-management, oauth
npx claudepluginhub databricks-solutions/databricks-apps-cookbook --plugin databricks-skills12 skills in this plugin
/cookbook-aimlInvoke ML models, run vector search, and connect to MCP servers from Databricks Apps. Use when the user wants to call a model serving endpoint, query a vector search index, use LLMs/embeddings, or connect to an MCP server in Dash, Streamlit, Reflex, or FastAPI./cookbook-authenticationImplement authentication in Databricks Apps: get current user info, on-behalf-of-user (OBO) auth, service principal auth, and OAuth patterns. Use when the user asks about auth, user tokens, service principals, OAuth, or OBO in Dash, Streamlit, Reflex, or FastAPI./cookbook-biEmbed AI/BI dashboards and integrate Genie Spaces into Databricks Apps. Use when the user wants to embed a Databricks dashboard or build a chat interface with the Genie Conversations API in Dash, Streamlit, or Reflex./build-appBuild Databricks Apps from this cookbook: minimum folder layout and app.yaml per framework (Dash, Streamlit, Reflex, FastAPI), multi-page wiring, docs category-first workflow then README recipes, runtime rules, combining recipes. Feature code only from repo samples and docs/docs/*.mdx. After the app runs, follow [`productionize-app-dab`](../productionize-app-dab/SKILL.md) for Databricks Asset Bundles (DABs). Do not use for AppKit, Genie App Builder, AI/BI dashboards, or coding-agent MCP config — see When not to use this skill./cookbook-computeConnect Databricks Apps to shared clusters or serverless compute using Databricks Connect. Use when the user needs to run Spark SQL or Python on a cluster from a Dash, Streamlit, or Reflex app./productionize-app-dabFollow-up to build-app: wrap the chosen cookbook framework (Dash, Streamlit, Reflex, FastAPI) in a Databricks Asset Bundle (DAB)—framework-specific src/app layout, app.yaml commands, bundle validate/deploy/run, CI/CD secrets. Requires a working app from build-app before applying. Self-contained YAML and commands.Other plugins' skills for the same job