繁体   English   中英

在Data Factory V2中读取Azure Blob的容器名称

[英]Read container names of an Azure blob in Data Factory V2

我的Data Factory V2管道从Azure Blob导入CSV文件。

Data Factory V2中有什么方法可以自动读取CSV文件所来自的容器的名称? 我搜索将它们移交给Microsoft SQL Server和/或将其保存在流式CSV数据本身中。

就像注释中提到的那样,Azure Blob存储中没有名为文件夹的东西。 您只能获取容器的名称。

基于Azure数据工厂REST API ,您可以从dataset响应主体获取folderPath

样本:

{
  "id": "/subscriptions/12345678-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/datasets/exampleDataset",
  "name": "exampleDataset",
  "properties": {
    "type": "AzureBlob",
    "typeProperties": {
      "folderPath": {
        "value": "@dataset().MyFolderPath",
        "type": "Expression"
      },
      "fileName": {
        "value": "@dataset().MyFileName",
        "type": "Expression"
      },
      "format": {
        "type": "TextFormat"
      }
    },
    "description": "Example description",
    "linkedServiceName": {
      "referenceName": "exampleLinkedService",
      "type": "LinkedServiceReference"
    },
    "parameters": {
      "MyFolderPath": {
        "type": "String"
      },
      "MyFileName": {
        "type": "String"
      }
    }
  },
  "etag": "280320a7-0000-0000-0000-59b9712a0000"
}

或者,您可以在Azure Data Factory SDK中获得该属性。 然后,您可以将名称保存到Microsoft SQL Server中。

希望对您有帮助。

暂无
暂无

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

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