Azure Blob 儲存到 Google Cloud Storage (GCS) 傳輸Operator¶
Google Cloud Storage (GCS) 用於儲存來自各種應用程式的大量資料。Azure Blob 儲存也是如此。本頁面展示瞭如何將資料從 Azure Blob 儲存傳輸到 GCS。
先決任務¶
要使用這些 operator,您必須完成以下幾項工作:
使用Cloud Console選擇或建立一個 Cloud Platform 專案。
為您的專案啟用結算功能,詳情請參閱Google Cloud 文件。
啟用 API,詳情請參閱Cloud Console 文件。
透過 pip 安裝 API 庫。
pip install 'apache-airflow[google]'有關安裝的詳細資訊,請參見安裝。
將資料從 Azure Blob 儲存傳輸到 Google Cloud Storage¶
Operator 將資料從 Azure Blob 儲存傳輸到 Google Cloud Storage 中指定的儲存桶
使用AzureBlobStorageToGCSOperator將資料從 Azure Blob 儲存傳輸到 Google Cloud Storage。
使用示例
tests/system/google/cloud/azure/example_azure_blob_to_gcs.py
transfer_files_to_gcs = AzureBlobStorageToGCSOperator(
task_id="transfer_files_to_gcs",
# azure args
container_name=AZURE_CONTAINER_NAME,
blob_name=BLOB_NAME,
# GCP args
bucket_name=GCP_BUCKET_NAME,
object_name=GCP_OBJECT_NAME,
filename=GCP_BUCKET_FILE_PATH,
gzip=False,
impersonation_chain=None,
)
參考¶
更多資訊請參閱