How-to

Configure environment variables

Applies to: .NET SDK, Node.js SDK Last updated: 2026-06-11

Variables the SDK reads

VariableSet byPurpose
HEXAEIGHT_LICENSECODEactivationLicense code from the Authenticator app
HEXAEIGHT_MACHINETOKENactivationMachine-specific authentication token
HEXAEIGHT_RESOURCENAMEactivationThe agent's identity name
HEXAEIGHT_SECRETactivationActivation secret (per-machine)
ENABLE_AZURE_CPU_BASED_LICENSINGoperatorSet to true on Azure Marketplace VMs

How the SDK loads them

The SDK looks for these variables in this order:

  1. Process environment (set via export or your container runtime)
  2. env-file in the current working directory (KEY=VALUE per line)
  3. 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