使用Microsoft Graph绑定在Outlook中收到的动态读取Excel文件 [英] Read Excel File on the fly that we received at outlook using Microsoft Graph bindings

查看:106
本文介绍了使用Microsoft Graph绑定在Outlook中收到的动态读取Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

你好吗?

我有以下情况:

每天,我们在Outlook中收到不同名称的Excel。在设计时间时,我们不知道这些名称,但它们是唯一的。

Each day, We receive Excels with different names in our Outlook. In designing time, we don't know that names but they are unique.

我们想要阅读该文件中的表格(例如,称为库存)并将该数据存储在数据库中。

We want to read a table in that files (for instance, called inventory) and store that data in a database.

我们希望存储这些文件(我们现在正在使用OneDrive for Business)并读取每个Excel文件的表格,库存。

We want to store that files (we are using now OneDrive for Business) and read that table, inventory, for each Excel file.

我们在收到文件或午夜时就读取文件是一样的。我们每天可以收到1个以上的文件。

It is the same for us to read the file as soon as we got it or at midnight. We can receive more than 1 file each day.

我们想使用Microsoft Graph绑定:

We want to use Microsoft Graph bindings:

- Excel表输入绑定允许您从Excel读取数据。

- OneDrive文件输入绑定允许您从OneDrive读取文件。

我们没有找到关于此的教程。 

We don't find a tutorial about this. 

我们的想法是:

1)将excel文件从Logic App上传到我们指定的Blob。



2)编写一个函数,该函数适用于与Azure函数关联的blob触发器

3)使用  Microsoft Graph绑定

3) Read data using Microsoft Graph bindings

4 )将数据存储到SQL 

你能帮助我们吗?

谢谢,

亲切的问候

推荐答案

对于第1步:


  1. 创建一个空白逻辑应用程序。
  2. 添加一个监视电子邮件附件的触发器。
  3. 添加检查电子邮件是否附件的条件。
  4. 添加为电子邮件和附件创建存储blob的操作。
  1. Create a blank logic app.
  2. Add a trigger that monitors emails for attachments.
  3. Add a condition that checks whether emails have attachments.
  4. Add an action that creates storage blobs for emails and attachments.

所有这些都在

使用Azure Logic Apps自动处理电子邮件和附件
doc。

All these are discussed in detail with step by step instruction in Automate handling emails and attachments with Azure Logic Apps doc.

< span style ="font-size:11.0pt; font-family:'Calibri',sans-serif">这里提到了两个额外的步骤,你可以根据你的要求绕过它们。

对于第2步:

现在接下来的事情就是读取blob存储中的excel文件。

创建 Azure Blob存储触发的
函数
并读取blob中的那些excel文件。

Create a function triggered by Azure Blob storage and read those excel files in blob.

Azure函数有

沙箱限制
,因为它不允许使用Office Interop。所以要读取这些excel文件,你需要使用OpenXml-SDK

Azure function has sandbox limits due to which it does not allow to use Office Interop. So to read those excel files, you need to use OpenXml-SDK

要使用Open XML,请确保在函数文件夹下创建了一个bin文件夹,

上传了DocumentFormat.OpenXml.dll和WindowsBase.dll。这个

SO
详细解释了这一点。

uploaded DocumentFormat.OpenXml.dll and WindowsBase.dll to it. This SO explain this in detail.

对于第3步和第4步: 

你可以通过这些讨论各种例子的文档
Azure功能的Microsoft图形绑定 
还有< GitHub中的每一个的href ="https://github.com/Azure/azure-functions-microsoftgraph-extension">
代码示例。


这篇关于使用Microsoft Graph绑定在Outlook中收到的动态读取Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆