I'm trying to use the remote config feature of InfluxDB and Telegraf. If I set the enviroment variable with
$env:INFLUX_TOKEN = "thisIsMyToken"
and then test things with
.\telegraf.exe --config "https://influxdbserver:port/myremoteconfig" --test
it seems to be working. When I try to install the service with
.\telegraf.exe --service install --config "https://influxdbserver:port/myremoteconfig"
the connection does not work and according to the windows event manager it can't load the config file due to "401 Unauthorized". Which is the same error I get when not setting the token before using the --test command. I assume the problem is with the service not seeing the enviroment variable. But how can I get the variable into the service?