首页 > 解决方案 > 在 Azure Blob 存储(或其他服务)中加载外部数据

问题描述

几个小时以来,我一直在尝试在 Azure 数据工厂和 Azure SQL Server 上找到解决问题的方法。

我无法相信做这个“简单的任务”有多复杂。好吧,它可能是我自己,我刚从天蓝色开始。

我有一个 Google Drive Sheet,我想将它上传到 Microsoft Azure SQL Server 的数据表中。该文件将每小时更新一次,因此该过程将每小时运行一次。

到目前为止,我尝试了什么。

1:我创建了一个 excel 文件,它连接到我的 Google 表格的https://www.excell-en.com/link-google-sheets-to-excel-tutorial 。我希望我能够将 azure 连接到 excel,转换为 CSV 并将其发送到 Microsoft SQL Server。不成功

  1. 我在我的谷歌表格中做了一个自动 CSV 导出,我可以从我的驱动器云中导入外部数据https://docs.microsoft.com/en-us/azure/storage/common/storage-import-export-data -to-blob?toc=/azure/storage/blobs/toc.json。不成功

  2. 我试图在 azure 中运行 python 脚本。我在导入库时遇到了困难并且不成功。

    import pandas as pd 
    import CSV
    datagooglesheets = "https://docs.google.com/spreadsheets/d/11wCTgaHMM/export?format=csv&gid=1659475835"
    datadictionnaryfull = "https://docs.google.com/spreadsheets/d/1Mv8hE/export?format=csv&gid870497447"
    
    
    datagooglesheets=pd.read_csv(datagooglesheets, sep=",", error_bad_lines=False, index_col=False, dtype="unicode",low_memory=False, na_values=["NA"])
    datadictionnaryfull=pd.read_csv(datadictionnaryfull, sep=",", error_bad_lines=False, index_col=False, dtype="unicode",low_memory=False, na_values=["NA"])
    datadictionnaryfull.rename(columns = {"drug_name":"all_drug_name"}, inplace = True)
    
  3. 尝试一下,我可以通过这种方式加载外部 google CSV 文件吗?https://abouconde.com/2019/03/03/attach-or-detach-an-external-storage-account-microsoft-azure-storage-explorer/

任何免费的解决方案将不胜感激!

工作流程是

  1. 加载 Azure Excel 表/或 google 表/或来自 Google Drive 的 Csv/或 Microsoft Drive 上的 CSV
  2. 将数据导入 Azure(每小时安排一次)
  3. 在 Azure SQL Server 数据表中返回(每小时更新新表)

标签: azure

解决方案


因此,对于您提到的工作流,您应该尝试使用 Azure 逻辑应用,它提供了最小的编码解决方案以及更少麻烦的方法。当我切换到它时,它对我来说也更便宜。 https://azure.microsoft.com/en-us/services/logic-apps/#overview


推荐阅读