I use Grafana in Docker (latest image from Docker Hub) and have an issue with using environment variables with provisioning file for datasources - datasources.yml.
According to github issue https://github.com/grafana/grafana/pull/16499 this should be supported.
Here is the output in the container.
bash-5.0$ more /etc/grafana/provisioning/datasources/datasources.yaml datasources: # JTI raw databases - name: juniper_1 type: influxdb access: proxy orgId: 1 url: http://db_1:8086 password: $INFLUXDB_PASS user: $INFLUXDB_USER database: juniper basicAuth: false isDefault: false editable: false bash-5.0$ env | grep INFLUX INFLUXDB_USER=test INFLUXDB_PASS=test
Now here is the behavior I haven’t expected: With this configuration when I enter Grafana web UI and go to the dashboard page, it tries to load data from the database for each panel, and then it prompts me to enter username and password with the following description:
The server is asking for your username and password. The server reports that it is from InfluxDB.
Obviously with the same user and pass which are in container’s environment variables directly in the file it works without any issue.
Any clues on this, has this been tested by someone?