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

岁酱吖の 提交于 2019-12-31 05:28:42

问题


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


回答1:


In the New Linked service Azure table storage and Click on Advanced and check Specify Dynamic contents in JSON format 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": [] } }




回答2:


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.



来源:https://stackoverflow.com/questions/56932728/how-to-provide-connection-string-dynamically-for-azure-table-storage-blob-storag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!