azure - Airflow 连接: How to create an airflow connection to Azure Blob Storage using Service Principal?

标签 azure airflow azure-blob-storage

我关注了这个doc尝试创建 Azure Blob 存储连接。我相信就我的情况而言,我希望通过 token 凭据进行连接。

但是,当我尝试保存且没有错误消息时,出现错误。我对是否在适当的位置提供 client_id、tenant_id、client_secret、sub_id 等感到有点困惑,因为 UI 没有指定除租户 id 之外的确切单词。在 Blob 存储 key (可选)输入中,我提供了客户端 key ,并且 Blob 存储登录名(可选)保存帐户名。对于额外部分,值是否需要遵循“extra__azure__...”?

任何建议都将受到高度赞赏!

enter image description here

我可以通过 azure cli 连接到 Blob 存储。 Airflow 版本是 2.4.3,作为 Docker 容器在 Kubernetes 上运行。

最佳答案

将 Airflow 与服务主体连接到 Azure Blob 存储。

  • 首先,您需要为适当的 Azure 应用程序创建服务主体并获取以下详细信息:

-- 应用程序客户端 ID

-- 租户 ID

-- 客户端 secret

  • 将存储 Blob 数据贡献者角色分配给 Azure Blob 存储中的服务主体,以便 Airflow 可以访问 Blob 对象。
  • 填写以下字段并测试连接

-- 连接 ID:输入连接的名称。

-- 帐户名称:输入存储帐户的Blob 服务 URL。例如。 https://mystorageaccount.blob.core.windows.net/

-- Blob 存储登录:输入您的应用程序(客户端)ID

-- Blob 存储 key :输入您的客户端 key

-- 租户 ID:输入您的目录(租户)ID

引用:Create an Azure Blob Storage connection in Airflow

关于azure - Airflow 连接: How to create an airflow connection to Azure Blob Storage using Service Principal?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77198205/

相关文章:

ios - Azure Blob 存储图像 URL? iOS

azure - 如何在 velero 部署上运行 helm 升级?

python - Airflow + Kubernetes Executor 资源版本太旧

airflow - 使用 DockerOperator 执行 python 和 bash 命令

azure - 逻辑应用程序 - Azure blob 存储 - 提取到存档文件夹操作 - RequestEntityTooLarge

c# - 在 blob 存储中并行上传 block

azure - 如何在azure逻辑应用程序中将 float 四舍五入为小数点后两位?

具有按时间触发的专用终结点的 Azure 函数应用程序 - 手动触发不起作用

azure - 在 Azure blob 上创建 PDF

python - 使用数据库信息构建动态 DAG