Set the value of an Environment Manager Airflow variable.
This command is only available on Astro.
Set the value of an Airflow variable. By default this command upserts: if the key doesn’t exist, the CLI creates it. Pass --strict to fail when the key is missing. Use --from-file to bulk-upsert variables from a dotenv file.
Usage
astro env airflow-variable update [<id-or-key>]
Options
Option
Description
Possible Values
<id-or-key>
The ID or key of the Airflow variable to update. Omit this argument when you use --from-file.
Any valid variable ID or key
-v,--value
The new variable value. If omitted, the CLI reads the value from stdin when piped, or prompts for it with the input hidden.
Any string
-s,--secret
When the variable doesn’t exist and the CLI creates it, mark it as secret. This has no effect when updating an existing variable.
None
--strict
Fail if the variable doesn’t exist instead of creating it.
None
--from-file
Bulk-upsert variables from a dotenv file. Pass - to read from stdin. Mutually exclusive with --value and the positional <id-or-key>.
Any valid file path, or -
--auto-link
Workspace scope only. Automatically link the variable to all Deployments in the Workspace, including future ones.
None
--workspace-id
Set the Workspace scope. Mutually exclusive with --deployment-id. Defaults to your current Workspace from CLI context.
Any valid Workspace ID
--deployment-id
Set the Deployment scope. Mutually exclusive with --workspace-id.
Any valid Deployment ID
Examples
# Update a Workspace Airflow variable's valueastro env airflow-variable update MY_VAR --workspace-id <workspace-id> --value new-value# Bulk-upsert Airflow variables from a dotenv fileastro env airflow-variable update --workspace-id <workspace-id> --from-file vars.env