Removing provisioned datasources

Hi,

We have just upgraded to v6.1.4 and I have noticed something’s weird with Datasource provisioning.
My provisioning path for datasources is /var/lib/grafana/provisioning/datsources/ and I have a few datasources that are being provisioned. However, when I remove any of the datasource yaml files from that path and reload grafana-server, I am still able to see the datasource in Grafana UI. I can’t delete it from the UI because we have set them to be non-editable. I don’t remember this happening in the earlier version or I might not have noticed it. So, is this expected? If not, does anybody know what I might be doing wrong?

Any help is much appreciated.

Thanks!

Sadly this is very hard to do right now.

Add this to the provisioning yaml

deleteDatasources:
  - name: "Name of the datasource"
    orgId: 1
2 Likes

That works. Note that the qoutation marks are required (I could not delete the datasource without quotation marks) and you need to restart the grafana service.

Is it possible to have the list of datasources provisioned synced with Grafana? So if I remove a datasource from provisioning, its deleted from Grafana as wall. We are using Ansible for provisioning Grafana, and this would make it truly idempotent. Adding datasources to deleteDatasources in an automated environment does not make too much sense.

1 Like