Set API Token Using Grafana.ini

Hi,

Is it possible to set the API token to be a specific value, ideally using the Grafana.ini?

I have a use-case where i would like to deploy multiple stateless replicas of Grafana using Helm which are accessible using Hubot. Dashboards and datasources loaded using the side-car method deployed through a seperate Helm chart.

Thanks,
Dean.

Hi,

Did you get any approach?

Hi, I do have exactly the same issue. For now, I’m thinking about creating a Jenkins Job that communicates with the Grafana API where the ServiceAccount and the token will be created.

The downside of this is that if there is a new deployment of Grafana, the account and token is gone. So I need to trigger a new Jenkins Job so that the account is created again. The other downside is that if you are running Grafana on multiple pods behind a VirtualService, only one pod is being provisioned with that account and token and that will result in Hubot not being able to render images sometimes.

So yes, in my case it would really help a lot if there’s another way to create those kind of accounts and tokens. Datasources and dashboards are already being provisioned from IaC so it would be really cool if this could be the same for ServiceAccounts.