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

Data source provisioning as code is broken #338

Open
jnunezgts opened this issue Mar 22, 2023 · 2 comments
Open

Data source provisioning as code is broken #338

jnunezgts opened this issue Mar 22, 2023 · 2 comments

Comments

@jnunezgts
Copy link

The data source provisioning is broken:

  1. If you define user authentication it is ignored by Grafana, you need to make the data source editable and then once is loaded in the UI you can provision it
  2. You cannot link a dashboard with the provisioned data source, even after providing a 'uid'. Instead Grafana ignores it and creates a new uid, which breaks the provisioning.

For example, the following breaks:

# User Authentication is broken for the provisioning!
# Workaround: Make the datasource editable and fix it after deployment
# https://github.com/grafana/grafana-json-datasource/issues/298
---
apiversion: 1
deleteDatasources:
  - name: "test"
datasources:
  - name: "test"
    type: marcusolsson-json-datasource
    url: https://machine.example.com/rest/api
    basicAuth: true
    basicAuthUser: "user"
    isDefault: false
    editable: true
    version: 11
    uid: "RD-rXQV4A"
    secureJsonData:
      basicAuthPassword: "ZZZ"

Grafana version: 9.2.4
OS: Linux Fedora 29
** Browser**: Chrome
** Plugin version**: 1.3.1

@bastifpv
Copy link

bastifpv commented Jul 6, 2023

same problem

@gabor
Copy link
Contributor

gabor commented May 24, 2024

hi @jnunezgts , sorry, i was not able to reproduce this. i tried it with a provisioning file like this:

apiVersion: 1

datasources:
  - name: jauth
    uid: jauth
    type: marcusolsson-json-datasource
    url: http://localhost:5555/test.json
    basicAuth: true
    basicAuthUser: user1
    secureJsonData:
      basicAuthPassword: pass1

and it created the datasource that had correct uid and sent the correct http-basic-auth info to the server.

could you try with the newest grafana version and with the newest json plugin version?

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

No branches or pull requests

3 participants