简体   繁体   English

如何使用 Azure 数据工厂获取 blob 存储帐户中的容器计数?

[英]How to get the count of containers in blob storage account using Azure Data Factory?

There is a blob storage account, the name of the blob storage account is azureblob11 it has a container with the name source .有一个 blob 存储帐户,该 blob 存储帐户的名称是azureblob11它有一个名为source的容器。

The container source contains 2 level subfolders.容器source包含 2 级子文件夹。

在此处输入图像描述

The folder structure looks similar:文件夹结构类似:

source (container)
  |--a (folder)
     |--ana (sub-folder)
     |--hem (sub-folder)
     |--thg (sub-folder)
     |--oud (sub-folder)
     

I have copied the sub-folders along with their data to the container level and created these 4 subfolders as new containers along with their data.我已将子文件夹及其数据复制到容器级别,并将这 4 个子文件夹及其数据创建为新容器。

The folder structure looks like this after copying the sub-folders to container level将子文件夹复制到容器级别后,文件夹结构如下所示

source (container)
  |--a (folder)
     |--ana (sub-folder)
     |--hem (sub-folder)
     |--thg (sub-folder)
     |--oud (sub-folder)
ana (container)
hem (container)
thg (container)
oud (container)     

The goal I am trying to achieve is to find the count of containers in the storage account that I have copied from sub-folder level to container level using Azure Data Factory.我试图实现的目标是使用 Azure 数据工厂找到我从子文件夹级别复制到容器级别的存储帐户中的容器计数。

Here is my list of Subfolder Ie, Output of Get Metadata:这是我的子文件夹列表,即获取元数据的 Output:

在此处输入图像描述

As a workaround we can count the subfolder instead of count container.As you are making containers from subfolder only.作为一种解决方法,我们可以计算子文件夹而不是计算容器。因为您只从子文件夹制作容器。

To get the count of subfolder you should use the length function.要获得子文件夹的数量,您应该使用长度function。

Step 1 > On a pipeline Create a Variable FolderCount of String type.步骤 1 > 在管道上创建 String 类型的变量 FolderCount。

在此处输入图像描述

Step 2 > Select the Set Variable Activity on GetMetaData DataSet.步骤 2 > Select GetMetaData 数据集上的设置变量活动。

在此处输入图像描述

Step 3 > Inside SetVariable Activity navigate to Variable and add dynamic content.第 3 步 > 在 SetVariable Activity 中导航到变量并添加动态内容。 在此处输入图像描述

在此处输入图像描述

Step 5: Now final debug.第 5 步:现在进行最终调试。

在此处输入图像描述

暂无
暂无

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

相关问题 使用新的 Azure.Storage.Blobs 时如何计算存储帐户中 Blob 存储容器的总大小 - How to calculate the total size of Blob storage containers in an storage account when using the new Azure.Storage.Blobs 将Azure Blob存储帐户链接到Azure数据工厂时出错 - Error linking Azure Blob Storage account to Azure Data Factory 从Azure数据工厂访问Azure Blob存储帐户 - Access Azure Blob storage account from azure data factory 如何检查 Azure blob 是否存在于多个容器的存储帐户中的任何位置? - How to check if Azure blob exists anywhere in storage account in multiple containers? 如何使用数据工厂将数据从 Azure Blob 存储增量加载到 Azure SQL 数据库? - How to incrementally load data from Azure Blob storage to Azure SQL Database using Data Factory? 如何使用Azure数据工厂获取Sharepoint数据并将其加载到Azure Blob存储中? - How to fetch Sharepoint data and load into Azure Blob Storage using Azure Data Factory? 如何使用 Azure 数据工厂更改 Azure blob 存储中文件的内容类型? - How to change the content-type of the files in Azure blob Storage using Azure Data Factory? Azure 数据工厂到 Azure Blob 存储权限 - Azure Data Factory to Azure Blob Storage Permissions 如何在 Azure 数据工厂中对 API 数据传输进行 Blob 存储? - How to do a Blob storage to API data transfer in Azure Data Factory? 使用 Azure 数据工厂管道从具有“类似文件夹的结构”的 Blob 存储中获取元数据 - Get metadata from Blob storage with "folder like structure" using Azure Data Factory pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM