簡體   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