Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow user creation

I am using Airflow version 1.8.2 and set up couple of Dags.Everything running as expected .I have admin user created for airflow web server access.But for other teams to monitor their job we can't provide this admin user So I tried to create a different user from the UI '/admin/user/'. But only the following fields are available .No options to provide roles or password etc. enter image description here

Does anyone faced the same issue or I am doing some wrong thing .How to create role based users So that I can tag some specific dags to those teams

Thanks

like image 200
Anoop R Avatar asked Jan 03 '18 06:01

Anoop R


Video Answer


1 Answers

As of Airflow 1.10, there is an airflow create_user CLI: https://airflow.apache.org/cli.html#create_user.

It supports roles and passwords:

airflow create_user [-h] [-r ROLE] [-u USERNAME] [-e EMAIL] [-f FIRSTNAME]
                    [-l LASTNAME] [-p PASSWORD] [--use_random_password]

Update: As of Airflow 2, this has been rolled into airflow users create: https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#create_repeat1

airflow users create [-h] -e EMAIL -f FIRSTNAME -l LASTNAME [-p PASSWORD] -r
                     ROLE [--use-random-password] -u USERNAME
like image 94
Micah Smith Avatar answered Sep 19 '22 17:09

Micah Smith