Create Dashboards in Multiple Orgs using Provisioning

Team,

I have an existing Grafana running as part of the dependency for prometheus-operator/kube-prometheus-stack chart. Grafana has a single Organization and few dashboards. I am trying to provision a new dashboard which should be created in a new Organization.

Here is the values.yaml snippet configuration I tried:

  dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
        - name: "app1Dashboards"
          orgId: 1
          folder: ""
          type: file
          disableDeletion: false
          allowUiUpdates: false
          options:
            foldersFromFilesStructure: false
            path: /tmp/dashboards
        - name: "app2Dashboards"
          orgId: 2
          folder: ""
          type: file
          disableDeletion: false
          allowUiUpdates: false
          options:
            foldersFromFilesStructure: false
            path: /tmp/app2/dashboards

However, using this configuration I encountered an error:

> t=2021-02-09T09:03:02+0000 lvl=eror msg="Failed to provision dashboard" logger=provisioning error="Failed to create provisioner: Failed to read dashboards config: failed to provision dashboards with "app2Dashboards" reader: Organization not found"
> t=2021-02-09T09:03:02+0000 lvl=eror msg="Stopped ProvisioningService" logger=server reason="Failed to create provisioner: Failed to read dashboards config: failed to provision dashboards with "app2Dashboards" reader: Organization not found"
> t=2021-02-09T09:03:02+0000 lvl=eror msg="A service failed" logger=server err="Failed to create provisioner: Failed to read dashboards config: failed to provision dashboards with "app2Dashboards" reader: Organization not found"
> t=2021-02-09T09:03:02+0000 lvl=eror msg="Server shutdown" logger=server reason="Failed to create provisioner: Failed to read dashboards config: failed to provision dashboards with "app2Dashboards" reader: Organization not found"
> Failed to create provisioner: Failed to read dashboards config: failed to provision dashboards with "app2Dashboards" reader: Organization not found

My use-case scenario is APP1 is for teamA and APP2 is for teamB and neither should be able to access the other Dashboard(s).

How do I create(provision) the second Org in helm chart?

Hi,

Did you try to use the Organization API to create the org beforehand.

Instead, this is a typical RBAC scenario, you should create user groups and restrict access to each dashboard folder using the API :

Hope it helps.

Good Luck