当前位置: 首页 > news >正文

Airflow - How to enable the test connection feature?

Airflow's test connection feature is disabled. How to enable it?

 

In Airflow 3.1.3, the Test Connection button and functionality is disabled by default across the UI, REST API, and CLI for security reasons. That’s why you’re seeing it greyed out or unavailable. Apache Airflow

How to enable it

You need to set the test_connection config in the [core] section of your airflow.cfg (or via environment variable):

Option 1 — Update airflow.cfg

Find your airflow.cfg and set:

[core]
test_connection = Enabled

This will:

  • Enable the test connection functionality

  • Activate the Test Connection button in the Airflow UI

  • Allow use of airflow connections test <conn_id> in the CLI Apache Airflow

Option 2 — Use an environment variable

Instead of modifying the file, set:

export AIRFLOW__CORE__TEST_CONNECTION=Enabled

(before starting Airflow). This has the same effect. Apache Airflow

What the possible values mean

ValueEffect
Disabled Test connection is disabled and button is shown but inactive (default) Apache Airflow
Enabled Test connection is allowed and button becomes active Apache Airflow
Hidden Test connection is disabled and button is completely hidden Apache Airflow

Other things to know

  • Even with this enabled, the connection type must have a hook with a test_connection() implementation — otherwise the test will fail or remain unusable. Apache Airflow

  • If your connection comes from an external secrets backend, the UI might still not allow testing it. Apache Airflow


Summary

To re-enable the Test Connection feature in Airflow 3.1.3:

  1. Set core.test_connection = Enabled in airflow.cfg or

  2. Set AIRFLOW__CORE__TEST_CONNECTION=Enabled in your environment

Then restart Airflow. After that, the UI should show and activate the Test Connection button for supported connection types.