Datasource provisioning: specify org name rather than id


I have a Grafana installation with multiple organizations, and I would like to use datasource provisioning to add datasources to specific organizations.

However, when provisioning datasources, it looks like it’s only possible to specify the organization via the “orgId” attribute. Upon testing, it looks like there is no “org_name” attribute (note: plugin provisioning, on the other hand, does have an “org_name” option).

For this to work, I need to be able to specify the organization by name.

Is it possible to specify the organization of a provisioned datasource by name?

1 Like

Hi @pcsegal,

According to the documentation for provisioning, it does not like org_name is supported. Do you think it’s possible to map names to ids for your use case?

@mattabrams, thank you for the reply.

That might be possible; the only complication is that orgIds aren’t predictable per installation, unlike org UID and org name (unless I’m mistaken). So, it seems like that would require discovering the existing orgIds via API, and then generating the datasource provisioning file by injecting the IDs into it via some templating system.

You might want to consider making a feature request in the repo, if you feel like the community at-large would benefit from this. very interesting issue!

I also need this feature. Its necessary if you would like to deploy the same datasources to multiple grafana servers (org_id is different on every grafana node)

1 Like

This topic was automatically closed after 365 days. New replies are no longer allowed.