Skip to main content
Your service’s code reads configuration, such as API URLs and sender addresses, from environment variables. Archie injects them into the service’s container when it deploys.

Open the variables

Open a service and select the Environment variables tab. The Shared badge on the tab tells you these variables aren’t specific to this service. The Environment variables tab with six variables whose values are masked, an empty row to add a variable, and a Secrets section. The tab explains it in one line: “These variables are shared by every function in this environment. Per-function variables are coming later.”

Shared with Settings

The tab shows the same variables as Backend → Settings → Environment variables. Both editors read and write the environment’s variables, so a change in one appears in the other. See Environment variables in Settings. Variables belong to an environment. A service in master receives the variables of master.

Add and edit variables

The Key and Value table lists your variables. Values are masked. Use the eye icon at the end of a row to show a value, and the X icon to remove the row.
  1. Type a name in the empty Add Key field at the bottom of the table, and its value in Add Value. Or click Add Variable.
  2. Click Save variables.
Click Cancel to discard changes you haven’t saved.
Saving doesn’t change a running service. The new values reach the service the next time you deploy. The deploy’s Load environment variables step picks them up.

Secrets

Scroll down below the variables table to the Secrets section. It holds values that must stay private. Archie describes them this way: “Encrypted and write-only: values are never shown again. Injected into the function container as secret env vars at deploy time.” The section has its own Key and Value table. Existing secrets show their keys with masked values. Click Add Secret to add a row, then click Save variables, the same button that saves the variables above. Use secrets for API keys, tokens, and passwords.
Don’t put sensitive values in plain variables or in your code. Plain values can be shown with the eye icon, and files are visible in the repository. Secrets are never shown again.

Read variables in your code

Your code reads variables the usual way for its language. In a Go service, for example, main.go reads the port with os.Getenv("PORT"). Use the exact key you entered, such as SENDER_EMAIL.

FAQ

Not yet. The tab states that per-function variables are coming later. For now, every service in the environment receives the same set.
Variables belong to one environment, and the tab shows the ones for the environment you selected. Check that each environment you deploy to has the variables your service needs. See Environments.
Variables are read when you deploy. Save the change, then click Deploy.