简体   繁体   中英

How to provide connection string dynamically for azure table storage/blob storage in Azure data factory Linked service

Dynamically changing the connection string for Tablestorage or blob storage in Azure data factory. Currently, I could see such option for database related dataset? How to achieve the same in Table or Blob storage

I believe this is what you wanted. https://docs.microsoft.com/en-us/azure/data-factory/parameterize-linked-services As doc mentioned, UI only supports 8 linked service. For others, you could change json code directly following the same pattern.

{
"name": "AzureBlobStorage12",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
    "parameters": {
        "accountName": {
            "type": "String"
        },
        "accountKey": {
            "type": "String"
        }
    },
    "annotations": [],
    "type": "AzureBlobStorage",
    "typeProperties": {
        "connectionString": "DefaultEndpointsProtocol=https;AccountName=@{linkedService().accountName};AccountKey=@{linkedService().accountKey};EndpointSuffix=core.windows.net;"
    }
}

}

在此处输入图片说明 You can't put the entire connection string as an expression. You need parameterize every part separately. Make sure you noticed the prameters field. And then every time you use the linked service, you will be able to pass different values to it.

在“新建链接的服务” Azure表存储中,单击“高级”,然后选中“以JSON格式指定动态内容adf”

Copy the below JSON to make it Table Storage Parameterize : { "name": "Table", "type": "Microsoft.DataFactory/factories/linkedservices", "properties": { "type": "AzureTableStorage", "typeProperties": { "sasUri": { "type": "SecureString", "value": "@{linkedService().sasUriParam}" } }, "parameters": { "sasUriParam": { "type": "String" } }, "annotations": [] } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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