【问题标题】:Linked Service parameterization not working for Linked Service of type Azure Data Explorer (Kusto)链接服务参数化不适用于 Azure 数据资源管理器 (Kusto) 类型的链接服务
【发布时间】:2020-03-20 12:28:45
【问题描述】:

我最初在 ADFv2 中成功创建了以下类型为 AzureDataExplorer 的链接服务,用于访问 ADX 中名为 CustomerDB 的数据库:-

{
"name": "ls_AzureDataExplorer",
"properties": {
    "type": "AzureDataExplorer",
    "annotations": [],
    "typeProperties": {
        "endpoint": "https://mycluster.xxxxmaskingregionxxxx.kusto.windows.net",
        "tenant": "xxxxmaskingtenantidxxxx",
        "servicePrincipalId": "xxxxmaskingspxxxx",
        "servicePrincipalKey": {
            "type": "AzureKeyVaultSecret",
            "store": {
                "referenceName": "ls_AzureKeyVault_MyKeyVault",
                "type": "LinkedServiceReference"
            },
            "secretName": "MySecret"
        },
        "database": "CustomerDB"
    }
},
"type": "Microsoft.DataFactory/factories/linkedservices"

}

这很顺利。由于显而易见的原因,我不得不掩盖一些值,但只是想说这种连接没有问题。现在受此 Microsoft documentation 的启发,我正在尝试创建此链接服务的通用版本,这是有道理的,因为否则如果集群中有 10 个数据库,我将不得不创建 10 个不同的链接服务。

所以我尝试通过以下方式创建参数化版本:-

{
"name": "ls_AzureDataExplorer_Generic",
"properties": {
    "type": "AzureDataExplorer",
    "annotations": [],
    "typeProperties": {
        "endpoint": "https://mycluster.xxxxmaskingregionxxxx.kusto.windows.net",
        "tenant": "xxxxmaskingtenantidxxxx",
        "servicePrincipalId": "xxxxmaskingspxxxx",
        "servicePrincipalKey": {
            "type": "AzureKeyVaultSecret",
            "store": {
                "referenceName": "ls_AzureKeyVault_MyKeyVault",
                "type": "LinkedServiceReference"
            },
            "secretName": "MySecret"
        },
        "database": "@{linkedService().DBName}"
    }
},
"type": "Microsoft.DataFactory/factories/linkedservices"

}

但在发布更改时,我不断收到以下错误:-

有什么解决办法吗?

文章明确表示:-

对于所有其他数据存储,您可以通过选择“连接”选项卡上的“代码”图标并使用 JSON 编辑器来参数化链接服务

因此,我的更改应该已成功发布。但我不断收到错误消息。

【问题讨论】:

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


    【解决方案1】:

    看来我需要在同一个 JSON 的其他地方指定参数。以下工作:-

    { 
    "name": "ls_AzureDataExplorer_Generic",
    "properties": {
        "parameters": {
                    "DBName": {
                        "type": "string"
                    }
                },
        "type": "AzureDataExplorer",
        "annotations": [],
        "typeProperties": {
            "endpoint": "https://mycluster.xxxxmaskingregionxxxx.kusto.windows.net",
            "tenant": "xxxxmaskingtenantidxxxx",
            "servicePrincipalId": "xxxxmaskingspxxxx",
            "servicePrincipalKey": {
                "type": "AzureKeyVaultSecret",
                "store": {
                    "referenceName": "ls_AzureKeyVault_MyKeyVault",
                    "type": "LinkedServiceReference"
                },
                "secretName": "MySecret"
            },
            "database": "@{linkedService().DBName}"
        }
    },
    "type": "Microsoft.DataFactory/factories/linkedservices"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-09
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 2020-09-27
      • 1970-01-01
      • 2019-09-27
      • 1970-01-01
      相关资源
      最近更新 更多