如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

huangapple go评论54阅读模式
英文:

How to create a logic app to copy files dynamically from on container to another storage blob container?

问题

我在查看 how-to-create-a-logic-app-to-copy-files-from-one-container-to-another 的内容,看起来很简单,但我想在源 Blob 存储容器中有新文件上传时动态运行它,我想将该文件复制到另一个目标 Blob 存储容器。如何实现这一点?

在逻辑应用工作流中遇到与连接相关的问题(我正在使用 Azure 服务主体作为身份验证)。

更新-1:

遇到错误:
如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

英文:

I was checking the how-to-create-a-logic-app-to-copy-files-from-one-container-to-another, it looks easy but I want to run this dynamically whenever there is new file uploaded to the source blob storage container, I want to copy that file to another destination blob storage container. How to implement this?

Getting issue with connection in logic app workflows(I am using azure service principal as authentication)

如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

Update-1:

Getting error:
如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

答案1

得分: 1

通过按照这个文档,您可以使用 Blob 存储连接器。我在我的端上重现了问题,通过以下步骤获得了预期的结果。

  • 首先,我创建了源存储账户(vijayastr)目标存储账户(vijstr0),并在 Azure 门户中创建了逻辑 App。
  • 在逻辑 App 中,根据您的要求搜索 Azure Blob 存储连接器,如下图所示,我将连接名称设置为 vijconnection,身份验证类型设置为访问密钥,然后提供了源 Blob 存储的账户名和密钥以建立连接。
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • 连接建立后,根据您的要求选择 当 Blob 添加或修改时触发,在存储账户名称或 Blob 终结点中显示 您已经创建的存储账户。从列表中选择源 Blob 存储,然后在容器中选择您已经创建的源存储账户的容器。(在建立连接之前,如我之前所说,我已经创建了两个 Blob 存储和这些存储账户的 Blob 容器
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • 然后,我选择了 获取 Blob 内容动作,并在下图中选择了源存储账户和 Blob。
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • 在获取 Blob 动作之后,用于将 Blob 从源存储移动到目标存储的创建 Blob 动作。
    注意: 在选择创建 Blob 后,点击更改连接,因为我们正在将数据移动到另一个 Blob 存储。点击更改连接,然后点击添加以创建新连接。
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • 创建 Blob 动作中建立新连接 后,在下图中提到您的目标 Blob 存储详细信息,并在 Blob 内容中使用动态表达式获取前一个动作 获取 Blob 内容 的文件内容。
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • 然后保存工作流并运行。逻辑 App 成功运行,如下图所示。每当源存储中发生更改时,它触发工作流,然后将上传到源存储的 Blob 移动到目标存储。
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
英文:

By following this MS document you can go through blob storage connector.
Issue reproduced from my end got expected results by following below steps.

  • First i created Source storage account(vijayastr) and destination storage account(vijstr0) and logic App in azure portal.
  • In logic App as per your requirement search for Azure blob storage connector and as shown in below image i have taken connection name as vijconnection , Authentication type as Access key and then provided the details like my source storage account name and key for establishing connection to source blob storage.
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • After connection established as per your requirement taken When a blob is added or modified trigger and here in storage account name or blob endpoint it displays your storage accounts(which you already created). Select source blob storage from list and then in container select the container of your source storage account which you already created.(As i said before establishing connection i already created 2 blob storages and blob containers for those storage accounts)
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • Then i have taken Get blob content action and selected Source storage account and blob as shown in below image.
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?
  • After Get blob action for moving blob from source stotage to destination storage taken create blob action.

Note: After selecting create blob click on change connection because we are moving data to another blob storage. Click on change connection and then click on add to create new connection.

如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

  • After establishing new connection in create blob action mention your destination blob storage detail as shown in below image and in blob content take File Content of previous action Get blob content by using dynamic expression.
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

  • Then save the workflow and Run. Logic App ran successfully as shown in below. Whenever changes done in source storage it trigger the workflow and then it moves blobs uploaded in source storage to destination storage.
    如何创建逻辑应用程序以动态从一个容器复制文件到另一个存储 Blob 容器?

huangapple
  • 本文由 发表于 2023年4月13日 16:09:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76003112.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定