1

My logic app receives a blob event when a blob is created via http:

Logic Apps Designer

I use an Event Grid Subscription, which triggers the Logic App via webhook, when a Blob Created event occurs.

A typical blob event received by the http trigger looks like:

[
  {
    "topic": "/subscriptions/xxxxxxx/resourceGroups/a-resource-group/providers/Microsoft.Storage/storageAccounts/ablobstorageaccount",
    "subject": "/blobServices/default/containers/testcontainer/blobs/9de2125e-5279-4375-bc60-c9987eb99251",
    "eventType": "Microsoft.Storage.BlobCreated",
    "eventTime": "2018-12-07T12:42:53.6561593Z",
    "id": "3c8f8611-001e-0029-722a-8eb18106aef2",
    "data": {
      "api": "PutBlob",
      "clientRequestId": "799b46aa-ff9f-4561-a087-36f790ab0df5",
      "requestId": "3c8f8611-001e-0029-722a-8eb181000000",
      "eTag": "0x8D65C41819B23B9",
      "contentType": "text/plain",
      "contentLength": 22,
      "blobType": "BlockBlob",
      "url": "https://ablobstorageaccount.blob.core.windows.net/testcontainer/9de2125e-5279-4375-bc60-c9987eb99251",
      "sequencer": "00000000000000000000000000003D5300000000018067c3",
      "storageDiagnostics": {
        "batchId": "be84f175-da20-4a44-8a8c-5d33a92fbcd3"
      }
    },
    "dataVersion": "",
    "metadataVersion": "1"
  }
]

How can I use this event data to specify the blob content, using the Designer's Get blob content action?

4

3 回答 3

7

除了@dbarkol 答案之外,以下屏幕片段还显示了使用表达式所在的路径获取 blob 内容:

uriPath(triggerBody()?['data'].url)

在此处输入图像描述

于 2018-12-08T08:20:16.963 回答
0

通常,您还可以为您的存储帐户设置共享访问签名,然后通过 . 这不是 Logtic Apps 特定的,但应该适用于任何 GET 调用。

此示例中提供了在具有事件网格和存储的逻辑应用中的这种用法示例

于 2018-12-18T23:23:47.030 回答
0

这样做的一种方法是通过路径:

  1. 从主题中提取容器名称
  2. 从主题中提取文件名
  3. 使用“使用路径获取 blob 内容”操作。您的 blob 路径将是 /{container-name}/{file-name}
于 2018-12-08T00:20:40.293 回答