Azure Blob 儲存體至 Google Cloud 儲存體 (GCS) 傳輸運算子¶
Google Cloud 儲存體 (GCS) 用於儲存來自各種應用程式的大量資料。Azure Blob 儲存體 也是如此。本頁說明如何將資料從 Azure Blob 儲存體傳輸到 GCS。
先決條件任務¶
若要使用這些運算子,您必須執行幾項操作
使用 Cloud Console 選擇或建立 Cloud Platform 專案。
如 Google Cloud 文件中所述,為您的專案啟用計費功能。
如 Cloud Console 文件中所述,啟用 API。
透過 pip 安裝 API 程式庫。
pip install 'apache-airflow[google]'詳細資訊請參閱 安裝。
將資料從 Azure Blob 儲存體傳輸到 Google Cloud 儲存體¶
運算子將資料從 Azure Blob 儲存體傳輸到 Google Cloud 儲存體中指定的儲存桶
使用 AzureBlobStorageToGCSOperator
將資料從 Azure Blob 儲存體傳輸到 Google Cloud 儲存體。
範例用法
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,
)