简体   繁体   English

如何将附加到邮件的文件移动到Azure上的VM

[英]How to move files attached to mail to a VM on Azure

so I'm new to Azure and I need to create a service that when given an office365 email (subscriber) will Automatically move files attached to new mails of the subscriber to VM on azure and then run some tests on them there (inside the VM). 所以我是Azure的新手,我需要创建一个服务,当给定office365电子邮件(订户)时,它将自动将附加到订户的新邮件的文件移动到Azure上的VM上,然后在其中运行(在VM内部)一些测试)。 The only way I found to implement it so far is creating a logic-app for each subscriber which is done manualy. 到目前为止,我发现实现它的唯一方法是为每个订户创建一个逻辑应用程序,这是手动完成的。

Any help would be appreciated! 任何帮助,将不胜感激!

Few things if you want to get started. 几件事,如果你想开始。

  1. Create the logic app that stores attachments to the database when a new email is received for a specific user 创建一个逻辑应用程序,该逻辑应用程序在收到特定用户的新电子邮件时将附件存储到数据库中
  2. Add some parameters to your logic app so user email/credentials/tenant are not hard coded. 将一些参数添加到您的逻辑应用程序中,以便不对用户电子邮件/凭证/租户进行硬编码。 https://blog.mexia.com.au/preparing-azure-logic-apps-for-cicd https://blog.mexia.com.au/preparing-azure-logic-apps-for-cicd
  3. Create an ARM Template to deploy this logic app. 创建一个ARM模板以部署此逻辑应用程序。
  4. Create another logic app that will deploy the previous logic app. 创建另一个将部署先前逻辑应用程序的逻辑应用程序。
  5. Whenever a new user is created, call the second logic. 每当创建新用户时,请调用第二个逻辑。

Also do you really need to store your files in a database ? 您还真的需要将文件存储在数据库中吗? As an alternative you can use Azure Blob Storage to store all these files. 或者,您可以使用Azure Blob存储来存储所有这些文件。

EDIT If you need to move the files to a VM, I would suggest you to do this: 编辑如果您需要将文件移动到VM,我建议您这样做:

  • When you receive an email 当您收到电子邮件时
    1. Store the attachments in Blob storage. 将附件存储在Blob存储中。
    2. Generate a SAS Token (with Read permission) 生成SAS令牌(具有读取权限)
    3. Put the URL + Sas Token of your file into aan Azure Servicebus Queue. 将文件的URL + Sas令牌放入Azure Servicebus队列。
    4. On the VM, Have a service that reads messages from the queue and download files. 在VM上,具有一项从队列读取消息并下载文件的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM