【问题标题】:How to provide connection string dynamically for azure table storage/blob storage in Azure data factory Linked service如何在 Azure 数据工厂链接服务中为 azure 表存储/blob 存储动态提供连接字符串
【发布时间】:2019-11-17 20:08:41
【问题描述】:

在 Azure 数据工厂中动态更改 Tablestorage 或 Blob 存储的连接字符串。目前,我可以看到数据库相关数据集的此类选项?如何在 Table 或 Blob 存储中实现相同的功能

【问题讨论】:

    标签: azure azure-data-factory azure-data-factory-2


    【解决方案1】:

    我相信这就是你想要的。 https://docs.microsoft.com/en-us/azure/data-factory/parameterize-linked-services 如文档所述,UI 仅支持 8 个链接服务。对于其他人,您可以按照相同的模式直接更改 json 代码。

    {
    "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;"
        }
    }
    

    }

    您不能将整个连接字符串作为表达式。您需要分别参数化每个部分。确保您注意到参数字段。 然后每次使用链接服务时,您都可以将不同的值传递给它。

    【讨论】:

    • 我们可以在链接服务级别参数化 Blob 存储吗?你有同样的例子吗?
    • 我们创建了从 Blob 存储动态复制活动到 SQL 的示例 - 我们能够在表存储级别进行参数化,我们希望在连接字符串级别(链接服务级别)进行参数化
    • 更新了我的答案。
    • 感谢刘芳。现在,我可以参数化 Blob 存储。现在,我面临另一个挑战,我可以通过 Post man 调用管道,我需要发送 Encyrpted SAS token 或加密的 Storage Key 才能使其工作。是否可以发送实际的 SAS 令牌或存储密钥来发布/触发管道。
    • 加密令牌和实际令牌是什么意思?我对此不是很熟悉。你能分享一个例子吗?
    【解决方案2】:

    在 New Linked service Azure table storage 中点击 Advanced 并勾选 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": [] } }

    【讨论】:

      猜你喜欢
      • 2019-01-26
      • 2021-12-22
      • 2019-09-27
      • 2020-12-22
      • 2022-08-03
      • 2020-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多