Overriding data source and variables when provisioning dashboards


[Grafana 8.0.3 and 8.3.3]

When provisioning dashboards in our production, I need to override the data source and some constant variables.

There is such an option when doing a manual import, as in the screenshot below where you can map the Prometheus data source and set a new value for a constant variable MY_CONSTANT_VAR:

But we cannot do this when provisioning dashboards. The only solution is to have some outside process that updates the dashboard JSON between dev and prod.

Ideally the dashboard provisioning YAML config should allow us to configure the mappings.

Any other ideas?



[EDIT] I later found a similar question here: https://community.grafana.com/t/dashboard-provisioning-with-variables/45516