【问题标题】:Load external data in Azure Blob Storage (Or Other Services )在 Azure Blob 存储(或其他服务)中加载外部数据
【发布时间】:2020-07-27 02:50:00
【问题描述】:

我已经在 Azure 数据工厂和 Azure SQL Server 上尝试找到解决问题的方法数小时。

我无法相信做这个“简单的任务”有多么复杂。好吧,可能是我自己,我刚开始使用 azure。

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

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

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

  1. 我在我的 Google 表格中进行了自动 CSV 导出,我可以从我的云端硬盘 https://docs.microsoft.com/en-us/azure/storage/common/storage-import-export-data-to-blobs?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


    【解决方案1】:

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

    【讨论】:

    • 似乎它会工作......但在我看来,该过程再次变得复杂以完成任务。触发、加载数据和创建 SQL 数据表。
    • 另一种方法是创建一个计时器触发器 Azure 函数,以从 Google Sheets API 中获取数据,就像您正在做的那样并将其插入到表中。我仍然建议使用逻辑应用方式,因为它会为您处理所有连接。
    猜你喜欢
    • 1970-01-01
    • 2017-12-16
    • 2019-12-07
    • 2021-07-02
    • 2018-01-11
    • 1970-01-01
    • 2012-05-24
    • 2019-11-11
    • 2021-04-20
    相关资源
    最近更新 更多