Skip to content

[BUG] Validation fails on alert resources when deployment target has a run_as other than its deployer #1868

@Jversen

Description

@Jversen

Describe the bug
The Databricks VS Code extension fails to refresh bundle configuration when a target has run_as set to a service principal and the bundle includes alert resources. The CLI (databricks bundle validate and databricks bundle deploy) both succeed without error, and the alert is successfully created in the workspace.

To Reproduce
Steps to reproduce the behavior:

  1. Create a databricks.yml with a target that has run_as set to a service principal
targets:
  dev:
    mode: development
    default: true
    workspace:
      host: https://<workspace-url>
    run_as:
      service_principal_name: <sp-app-id>
  1. Create an alert resource
resources:
 alerts:
   my_alert:
     display_name: My Alert
     query_text: SELECT 1
     warehouse_id: <warehouse-id>
     evaluation:
       comparison_operator: GREATER_THAN
       empty_result_state: OK
       source:
         name: "1"
       threshold:
         value:
           double_value: 0
     schedule:
       quartz_cron_schedule: "0 0 3 * * ?"
       timezone_id: UTC
  1. Run databricks bundle validate -t dev in the terminal. Succeeds
  2. Run databricks bundle deploy -t dev in the terminal. Succeeds, alert is created
  3. Open the project in VS Code with the Databricks extension and select the dev target
  4. The extension output log shows:
[info] summarize: Error: alerts do not support a setting a run_as user that is different from the owner.
Current identity: <user_email>. Run as identity: <sp-app-id>.
See https://docs.databricks.com/dev-tools/bundles/run-as.html to learn more about the run_as property.
  in resources/alerts.yml:3:5
[error] summarize: Failed to refresh bundle configuration.
  1. Nothing is visible in the Bundle Resource Explorer, and deploy from there is not possible.

System information:

  1. Paste the output of the Help: About command (CMD-Shift-P):
    Version: 1.112.0 (user setup)
    Commit: 07ff9d6178ede9a1bd12ad3399074d726ebe6e43
    Date: 2026-03-17T18:09:23Z
    Electron: 39.8.0
    ElectronBuildId: 13470701
    Chromium: 142.0.7444.265
    Node.js: 22.22.0
    V8: 14.2.231.22-electron.0
    OS: Windows_NT x64 10.0.22631

  2. Databricks Extension Version: 2.10.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions