气流:在环境变量中存储连接,用于数据块连接

Airflow: Storing a Connection in Environment Variables , for databricks connection

我想将我的数据块连接信息存储为环境变量。 如

所述

https://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html#:~:text=create%20the%20connection.-,Editing%20a%20Connection%20with%20the%20UI,button%20to%20save%20your%20changes.

我也在看以下内容: https://docs.databricks.com/dev-tools/data-pipelines.html

它说将登录设置为:{“token”: “abc”, “host”:"123"} 我不确定要导出什么……有人知道吗??我有令牌等......但出口声明是什么?

如果您已经从 Airflow UI 创建了连接,请打开终端并输入此命令:airflow connections get your_connection_id.

示例:

$ airflow connections get sqlite_default
Id: 40
Conn Id: sqlite_default
Conn Type: sqlite
Host: /tmp/sqlite_default.db
Schema: null
Login: null
Password: null
Port: null
Is Encrypted: false
Is Extra Encrypted: false
Extra: {}
URI: sqlite://%2Ftmp%2Fsqlite_default.db

URI 键具有可用于创建环境变量的值。按照这个例子,将是:

export AIRFLOW_CONN_MY_PROD_DATABASE='sqlite://%2Ftmp%2Fsqlite_default.db'

希望对你有用! source