How-to
Configure environment variables
Variables the SDK reads
| Variable | Set by | Purpose |
|---|---|---|
HEXAEIGHT_LICENSECODE | activation | License code from the Authenticator app |
HEXAEIGHT_MACHINETOKEN | activation | Machine-specific authentication token |
HEXAEIGHT_RESOURCENAME | activation | The agent's identity name |
HEXAEIGHT_SECRET | activation | Activation secret (per-machine) |
ENABLE_AZURE_CPU_BASED_LICENSING | operator | Set to true on Azure Marketplace VMs |
How the SDK loads them
The SDK looks for these variables in this order:
- Process environment (set via
exportor your container runtime) env-filein the current working directory (KEY=VALUE per line)- SQLite database
hexaeightkeys.db(Azure path only)
Overriding via environment
# bash / WSL
export HEXAEIGHT_RESOURCENAME="my-agent.example.com"
export HEXAEIGHT_LICENSECODE="..."
dotnet run
# PowerShell
$env:HEXAEIGHT_RESOURCENAME = "my-agent.example.com"
dotnet run Loading a specific env-file path
If your env-file is not in the current working directory:
// .NET — load env-file before constructing Client
foreach (var line in File.ReadAllLines("/etc/hexaeight/env-file"))
{
int eq = line.IndexOf('=');
if (eq > 0)
Environment.SetEnvironmentVariable(
line.Substring(0, eq).Trim(),
line.Substring(eq + 1).Trim());
}
var client = new Client(); See also
- Activating an identity How-to
- Verify the installation How-to