# Set SQL Warehouse Config — Databricks (Service Principal)

> Updates the global configuration for SQL Warehouses. See the documentation

- Key: `databricks_oauth-set-sql-warehouse-config`
- Type: Action (Write)
- Version: 0.0.1
- App: Databricks (Service Principal) (`databricks_oauth`) — https://pipedream.com/apps/databricks-oauth.md
- This page (HTML): https://pipedream.com/apps/databricks-oauth/actions/set-sql-warehouse-config
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/databricks_oauth/actions/set-sql-warehouse-config/set-sql-warehouse-config.mjs

## Description

Updates the global configuration for SQL Warehouses. [See the documentation](https://docs.databricks.com/api/workspace/warehouses/setworkspacewarehouseconfig)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `instanceProfileArn` | `string` | No | Instance profile ARN used to pass an IAM role to clusters (AWS). |
| `googleServiceAccount` | `string` | No | Service account email used for GCP workspaces, if applicable. |
| `securityPolicy` | `string` | No | Workspace-wide security policy for SQL Warehouses (if applicable). |
| `channel` | `object` | No | Channel details. Example: { "name": "CHANNEL_NAME_CUSTOM", "dbsql_version": "2023.35" } |
| `enabledWarehouseTypes` | `string[]` | No | Specify which warehouse types are enabled. Example item: { "warehouse_type": "PRO", "enabled": true } |
| `configParam` | `object` | No | General config key/value pairs. Example item: { "key": "some.config", "value": "true" } |
| `globalParam` | `object` | No | Global config key/value pairs applied to all warehouses. |
| `sqlConfigurationParameters` | `object` | No | SQL-specific configuration key/value pairs. |
| `dataAccessConfig` | `object` | No | Key/value pairs for data access configuration (e.g., credentials passthrough, external storage access). |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "databricks_oauth",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "databricks_oauth-set-sql-warehouse-config",
  arguments: {
    instanceProfileArn: "Instance Profile ARN",
    googleServiceAccount: "Google Service Account",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "databricks_oauth-set-sql-warehouse-config",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    databricks_oauth: { authProvisionId: "apn_xxxxxxx" },
    instanceProfileArn: "Instance Profile ARN",
    googleServiceAccount: "Google Service Account",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "databricks_oauth-set-sql-warehouse-config",
    "configured_props": {
      "databricks_oauth": { "authProvisionId": "apn_xxxxxxx" },
      "instanceProfileArn": "Instance Profile ARN",
      "googleServiceAccount": "Google Service Account"
    }
  }'
```

---

- App: https://pipedream.com/apps/databricks-oauth.md · All apps: https://pipedream.com/apps
