在ADF中参数化Azure Blob存储链接服务

时间:2019-05-09 21:19:18

标签: azure azure-storage-blobs azure-data-factory

我想创建一个Azure Data Factory管道,将文件复制到多个存储帐户。我的计划是将管道参数中的存储帐户连接信息定义为一个数组,并使用ForEach活动遍历该数组中的每个对象,将连接信息传递到另一个管道。

    [
  {
    "destinationBlob": {
      "connectionString": "Conn1"
    }
  },
  {
    "destinationBlob": {
      "connectionString": "Conn2"
    }
  },
  {
    "destinationBlob": {
      "connectionString": "Conn3"
    }
  }
]

我的问题是,是否可以参数化与Azure Blob存储链接服务的连接?

3 个答案:

答案 0 :(得分:1)

基于document,链接服务的ADF参数化不支持Azure Blob存储。

enter image description here

因此,到目前为止,您只能将特定文件复制到目标位置。

答案 1 :(得分:0)

实际上可以做到。样本JSON:

{
"name": "DataLakeBlob",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
    "parameters": {
        "StorageAccountEndpoint": {
            "type": "String",
            "defaultValue": "https://testblobstorage.blob.core.windows.net"
        }
    },
    "type": "AzureBlobStorage",
    "typeProperties": {
        "serviceEndpoint": "@{linkedService().StorageAccountEndpoint}"
    },
    "description": "Test Description"
}

}

答案 2 :(得分:0)

编辑:这已被Microsoft确认。 https://docs.microsoft.com/en-us/azure/data-factory/parameterize-linked-services#

对于那些寻求SAS令牌参数化的人,可以使用以下JSON。 确保选中屏幕快照中的复选框以应用JSON。 enter image description here

{
  "type":"Microsoft.DataFactory/factories/linkedservices",
  "properties":{
  "parameters": {
        "StorageAccountEndpoint": {
            "type": "String",
            "defaultValue": "https://<<yourstorageaccountname>>.blob.core.windows.net/?sv=2018-03-28&ss=b&srt=sco&sp=rwdlac&se=2019-10-20T16:33:57Z&st=2019-09-20T08:33:57Z&spr=https&sig=lDrBjD%2BjM2T1XjRW997VPMqDp99ZxVoReyRK0VEX7zQ%3D"
        }
    },
    "type": "AzureBlobStorage",
    "typeProperties": {
        "sasUri": "@{linkedService().StorageAccountEndpoint}"
    }

}}