Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with ServiceAccounts bearer tokens in place of API Keys #132

Open
vineethvijay7 opened this issue Jan 26, 2024 · 5 comments
Open

Work with ServiceAccounts bearer tokens in place of API Keys #132

vineethvijay7 opened this issue Jan 26, 2024 · 5 comments

Comments

@vineethvijay7
Copy link

In latest Grafana version, we longer has the API Keys available. Was wondering if there is a hack/update to make this amazing tool to work with the alternative "ServiceAccounts bearer tokens"

@vineethvijay7 vineethvijay7 changed the title How to make it work with ServiceAccounts bearer tokens rather than API Keys Work with ServiceAccounts bearer tokens rather than API Keys Jan 26, 2024
@vineethvijay7 vineethvijay7 changed the title Work with ServiceAccounts bearer tokens rather than API Keys Work with ServiceAccounts bearer tokens in place of API Keys Jan 26, 2024
@mpostument
Copy link
Owner

mpostument commented Jan 26, 2024

What error you are getting when trying to use it with service account token?
I don't expect it to work differently

@vineethvijay7
Copy link
Author

vineethvijay7 commented Feb 1, 2024

Error:

./grafana-sync push-dashboards --apikey="SERVICE_ACCOUNT_TOKEN_HERE=" --directory="dashboards" --url http://my-domain.com
2024/02/01 15:12:53 error on importing dashboard my-dashboard
...

The token has necessary permissions and has been tested using grafana api.

But I suppose the problem might be also transparent from the command, it is supposed to be working with just apikey ?

@mpostument
Copy link
Owner

I will try to look at this. But if new token is not supported, not sure if i will be able to do something. Looks like grafana sdk is no longer active

https://github.com/grafana-tools/sdk

@mpostument
Copy link
Owner

@vineethvijay7 i tried on grafana 10.2, service account with editor role. And i was able to pull folder, dashboards

@mpostument
Copy link
Owner

Also tried grafana 10.3. Service account with editor permissions, was able to do pull and push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants