I have file called properties.json
which looks like
{
"FOO": {
"var1": "apple",
"settings": {
"more_settings": {
"var2": "pear",
"var3": 123
}
}
},
"BAR": "FOO"
}
and I'm trying to import into Airflow via the command line interface like so
gcloud composer environments run <composer-name> \
--location <location> --project <project> variables -- \
--import /path/to/properties.json
in order to get the following variables into Airflow:
FOO: { "var1": "apple", "settings": { "more_settings": { "var2": "pear", "var3": 123 } } }
BAR: FOO
However, when I run the gcloud command, I get the error Missing variables file.
When I import properties.json
in Airflow's UI, it is imported without issues. What am I doing wrong by using the CLI?
I have done this:
airflow variables import properties.json
According to: https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#import_repeat2
For older versions 1.10.x of Airflow, using CLI, the syntax is:
airflow variables -i <file.json>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With