Hey Egor - Variable substitution inside dashboard SQL (e.g., dashboard.json or serialized_dashboard content) is not natively supported. This means that variables defined in databricks.yml will not be automatically replaced inside dashboard SQL queries. To achieve environment-specific SQL in dashboards, you need to preprocess or template the dashboard JSON file yourself before deployment as a workaround.
Fortunately, native support for this feature is planned.
I would look into Databricks Asset Bundles. They fully support defining variables in databricks.yml for jobs and other YAML-based configs, including environment-specific overrides (for dev, tst, prd, etc.). In jobs (job.yml, YAML config), you can reference these variables directly using the ${var.variable_name} pattern, and these values will be correctly substituted when deploying to different environments.