How do I set astronomer config file options (Env Vars)?

How do I set astronomer config file options? Specifically I want to set webserver.hide_paused_dags_by_default to true.

Hi @btallman! To add Environment Variables to your deployment on Astro, you can do one of 3 things:

1. Add them to your Dockerfile (Local + Astro Deployment)

Any Environment Variables you want to configure can go straight in your Airflow project’s Dockerfile, which you’ll see by default as soon as you create it via the Astro CLI with an astro dev init.

Most customers take this path, since it’s an effective way to both test your project locally and push it up to Astronomer Cloud once you’re ready. For the Env Var that you mentioned, you’d add the following line:

ENV AIRFLOW__WEBSERVER__HIDE_PAUSED_DAGS_BY_DEFAULT=TRUE

Full list of Environment Variables pre-populated in the Astronomer UI here and a corresponding description of each in in Airflow docs here.

2. Add them via the Astronomer UI (Astro Deployment Only)

For your deployment on Astronomer Cloud, you can also add Environment Variables via app.astronomer.cloud > Deployments > Configure > Environment Vars

You’ll see a drop-down menu of options as soon as you click into a text field. That particular Env Var will look something like this:

3. Bring them in from a specified file via an --env flag from the CLI (local only)

Astronomer v0.8’s CLI comes with the ability to bring in Environment Variables from a specified file by running astro airflow start with an --env flag. More guidelines in a section in our “Customizing your Image” doc.

Note: If you’re on Cloud v0.7.5, we backported this feature into a new CLI version while we wait for v0.8. For access to this feature (and airflow_settings.yaml), install:

curl -sSL https://install.astronomer.io | sudo bash -s -- v0.7.5-2

1 Like

An update to this post for v0.10.3+

For local only environment variables, such as those related to https://www.astronomer.io/guides/airflow-scaling-workers/ you can add them to the .env file of your project.