最初,我成功在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编辑器来参数化链接的服务
因此,我的更改应该已经成功发布。但我不断收到错误消息。
答案 0 :(得分:0)
似乎我需要在同一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"
}