This command is only available on Astro.
--strict to fail when the key is missing. Use --from-file to bulk-upsert variables from a dotenv file.
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Set the value of an Environment Manager Airflow variable.
--strict to fail when the key is missing. Use --from-file to bulk-upsert variables from a dotenv file.
astro env airflow-variable update [<id-or-key>]
| 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 |
# Update a Workspace Airflow variable's value
astro env airflow-variable update MY_VAR --workspace-id <workspace-id> --value new-value
# Bulk-upsert Airflow variables from a dotenv file
astro env airflow-variable update --workspace-id <workspace-id> --from-file vars.env
Was this page helpful?