Using Airflow 2.7.2, I want to use the variable encryption function, as seen in the image below
I have install Airflow standalone, but is not giving the option.
After reading documentation, we need to install and use Fernet module for the encryption
# Install Cryptography
pip install apache-airflow[crypto,postgres,ssh,s3,log]
pip install cryptography
# Generate secret key, and store in /home/airflow/airflow.cfg
python3 -c "from cryptography.fernet import Fernet; print (Fernet.generate_key ().decode ())"
vi /home/airflow/airflow.cfg
After restarting the Airflow, still not working. What am I missing?
Thanks!
By default, airflow considers your variable secret if your variable name has a string like
You can set
sensitive-var-conn-names
in the configuration to mark your variable secret. for example, if setAIRFLOW__CORE__SENSITIVE_VAR_CONN_NAMES=test,example
it would consider the variable as secret if the variable name has substring test or examplehttps://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#sensitive-var-conn-names