簡體   English   中英

如何在 Azure 數據工廠中集成 Python 代碼

[英]How to integrate Python Code in Azure Data Factory

我的 Azure 數據工廠中有一個文本分隔文件。 我必須將其轉換為 json 文件。 我還有一個 python 代碼,可將我的文本分隔文件轉換為 json 文件。 現在我如何將這個 python 代碼集成到 azure 數據工廠中。 如何從 ADF 運行此代碼?

You can use the Azure Data Factory Data Flow to do a lot of transforms like csv to JSON without Python (see this answer: Convert csv files,text files,pdf files into json using Azure Data Factory ).

如果您需要 Python 提供的控件,您可以使用 Azure 批處理來運行您的 python 文件。 在您的 python 中,您可以使用 blob_client.download_blob() 從 blob 中獲取 csv,以將其下載到批處理 VM 上的本地文件中。 然后您可以正常加載文件(pd.read_csv())並進行轉換。 在本地編寫 json 文件后,您可以上傳回 blob,然后執行您想要的任何其他 ADF 操作。 我使用這組指令開始運行 Azure Batch python: https://docs.microsoft.com/en-us/azure/batch/quick-run-python

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM