Azure数据工厂-动态帐户信息-连接的参数化 [英] Azure Data Factory - Dynamic Account information - Parameterization of Connection

查看:40
本文介绍了Azure数据工厂-动态帐户信息-连接的参数化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档演示了如何为连接的服务创建参数,而不是如何从数据集或活动中实际传递该参数.基本上,连接字符串来自lookup foreach循环,我想连接到存储表.

The documentation demonstrates how to create a parameter for a connected service but not how to actual pass in that parameter from a dataset or activity. Basically the connection string is coming from a lookup foreach loop and I want to connect to a storage table.

连接看起来像这样.传递正确的参数后,该测试将起作用:

The connection looks like this. The test works when passing in a correct parameter:

{
    "name": "StatsStorage",
    "properties": {
        "type": "AzureTableStorage",
        "parameters": {
            "connectionString": {
                "type": "String"
            }
        },
        "annotations": [],
        "typeProperties": {
            "connectionString": "@{linkedService().connectionString}"
        }
    }
}

以下是数据集,我正在努力确定如何设置连接的connectionString参数.数据集具有两个参数,即来自数据库的连接字符串和需要连接至的表名:

The dataset is the following, I'm struggling to determine how to set the connectionString parameter for the connection. The dataset has two parameters, the connectionstring from the db and the tablename that it needs to connect to:

{
    "name": "TestTable",
    "properties": {
        "linkedServiceName": {
            "referenceName": "StatsStorage",
            "type": "LinkedServiceReference"
        },
        "parameters": {
            "ConnectionString": {
                "type": "string"
            },
            "TableName": {
                "type": "string"
            }
        },
        "annotations": [],
        "type": "AzureTable",
        "schema": [],
        "typeProperties": {
            "tableName": {
                "value": "@dataset().TableName",
                "type": "Expression"
            }
        }
    }
}

如何在连接上设置连接字符串?

How do I set the connection string on the connection?

推荐答案

  1. 首先,您不能将整个连接字符串用作表达式.您需要分别提供accountName和accountKey.请参阅这篇文章,了解如何做. 如何提供连接动态字符串以用于Azure数据工厂链接服务中的天蓝色表存储/blob存储
  2. 然后,如果您使用的是ADF UI,它将指导您如何为链接服务提供价值.例如,如果您有两个数据集参数,则可以如下指定.
  3. 如果要查看json代码,可以单击左上角的代码图标.
  4. 我以azure blob为例,但是azure表几乎相同. 希望它能有所帮助.
  1. First, you can't make the whole connection string as an expression. You need provide accountName and accountKey sperately. Refer this post about how to do it. How to provide connection string dynamically for azure table storage/blob storage in Azure data factory Linked service
  2. Then, if you are using ADF UI, it will guide you how to provide value for linked service. For example, if you have two dataset parameters, you could specify it as following.
  3. If you want to see json code, you could click the code icon on the top left corner.
  4. I am using azure blob as an example, but the azure table is almost the same. Hope it could help.

这篇关于Azure数据工厂-动态帐户信息-连接的参数化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆