使用 azure 数据工厂从容器中检索 blob url

using azure data factory to retrieve blobs urls from a container

我正在使用 Azure,我在容器中有一些 blob,我正在寻找的是使用 azure 数据工厂将这些 blob 的 url 复制到 json 文件中或数据流。

这里是 url 的例子:

预期结果是:

[[{'ur':'urltObLOB1'},{'ur':'urltObLOB2'},{'ur':'urltObLOB3'},.....]

有没有办法使用 Azure 数据工厂或数据流来实现?

我找不到 activity 或开箱即用的方法来实现询问。但是,如果您查看 REST api

The List Blobs operation returns a list of the blobs under the specified container.

In version 2013-08-15 and newer, the EnumerationResults element contains a ServiceEndpoint attribute specifying the blob endpoint, and a ContainerName field specifying the name of the container. In previous versions these two attributes were combined together in the ContainerName field. Also in version 2013-08-15 and newer, the Url element under Blob has been removed.

签出 MS DOC List blobs and snapshots

一个示例显示了在名为 mycontainer.

的容器中 returns blob 和快照的列表操作的结果

请求URI如下:

GET https://myaccount.blob.core.windows.net/mycontainer?restype=container&comp=list&include=snapshots&include=metadata

示例 XML 响应包含容器中每个 blob 的块。

   <Blob>  
      <Name>blob3.txt</Name>  
      <Url>https://myaccount.blob.core.windows.net/mycontainer/blob3.txt</Url>  
      <Properties>  
        <Last-Modified>Wed, 09 Sep 2009 09:20:03 GMT</Last-Modified>  
        <Etag>0x8CBFF45D911FADF</Etag>  
        <Content-Length>16384</Content-Length>  
        <Content-Type>image/jpeg</Content-Type>  
        <Content-Encoding />  
        <Content-Language />  
        <Content-MD5 />  
        <Cache-Control />  
        <x-ms-blob-sequence-number>3</x-ms-blob-sequence-number>  
        <BlobType>PageBlob</BlobType>  
        <LeaseStatus>locked</LeaseStatus>  
      </Properties>  
      <Metadata>  
        <Color>yellow</Color>  
        <BlobNumber>03</BlobNumber>  
        <SomeMetadataName>SomeMetadataValue</SomeMetadataName>  
      </Metadata>  
    </Blob> 

您可以在 <Url> </Url>

之间找到 blob URL

接下来您可以解析 XML 输出以将 url 值存储在管道中的数组变量中。