Skip to content

Bug: Error unmarshalling App/Installation ID when configured through environment variables #477

@Tate-CC

Description

@Tate-CC

I'm trying to provision a GitHub data source from a config file, using environment variables to substitute in the secret values. The issue I'm hitting is that the App and Installation IDs are numeric strings and I can't get the config to interpret them as strings.

The exact error I'm getting is:

json: cannot unmarshal number into Go struct field Settings.appId of type string

My config file looks like this:

apiVersion: 1
datasources:
  - name: GitHub
    type: grafana-github-datasource
    jsonData:
      selectedAuthType: github-app
      appId: $GITHUB_APP_ID
      installationId: $GITHUB_INSTALLATION_ID
    secureJsonData:
      privateKey: $GITHUB_PRIVATE_KEY

And my environment variables look like:

GITHUB_APP_ID=1111111
GITHUB_INSTALLATION_ID=11111111

I've also tried wrapping the variable in quotes but this causes a parse error, and I've tried wrapping the config value in quotes but that didn't seem to make a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions