# Datasource provisioning: specify org name rather than id

**URL:** <https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675>\
**Category:** Grafana\
**Tags:** provisioning\
**Created:** [April 27, 2021, 11:51am UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675 "2021-04-27T11:51:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcsegal](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@pcsegal](https://community.grafana.com/u/pcsegal)\
**Post date:** [April 27, 2021, 11:51am UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/1 "2021-04-27T11:51:12Z")

</div>

Hello,

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?

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [May 5, 2021, 12:08am UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/2 "2021-05-05T00:08:19Z")

</div>

Hi @pcsegal,

According to [the documentation for provisioning](https://grafana.com/docs/grafana/latest/administration/provisioning/#example-data-source-config-file), it does not like `org_name` is supported. Do you think it’s possible to map names to ids for your use case?

---

<div class="post-metadata">

**Author:** ![pcsegal](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@pcsegal](https://community.grafana.com/u/pcsegal)\
**Post date:** [May 13, 2021, 11:44am UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/3 "2021-05-13T11:44:16Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [May 26, 2021, 4:42pm UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/4 "2021-05-26T16:42:21Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![philor](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@philor](https://community.grafana.com/u/philor)\
**Post date:** [September 9, 2021, 3:28pm UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/5 "2021-09-09T15:28:42Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [April 27, 2022, 11:51am UTC](https://community.grafana.com/t/datasource-provisioning-specify-org-name-rather-than-id/46675/6 "2022-04-27T11:51:56Z")

</div>

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