【发布时间】:2020-04-06 18:41:51
【问题描述】:
我正在尝试使用 ADF GUI 在 Azure 数据工厂 (ADF) 中配置链接服务,当我输入要连接的数据库的密码时,我收到以下错误消息:
Connection failed
Expecting connection string of format "key1=value1; key2=value2"
如果我将其配置为从 Keyvault 获取此密码,则会收到以下错误消息:
The value of the property '' is invalid: 'Format of the initialization string does not conform to specification starting at index 105
我尝试使用 DBeaver 连接到这个数据库,我可以毫无问题地连接,因此 URL、密码和用户是正确的,我认为问题出在密码字符串中,因为它包含分号 (;),我的密码是这样的:
pass(GdA;+pass
所以我认为问题在于我必须转义分号才能配置该链接服务(如果我删除这个分号,我会收到登录错误)。我已经尝试过其他帖子所说的:1 和 2 但我仍然无法配置此链接服务。
也许我必须尝试使用 Azure CLI 创建此链接服务,但您还有其他建议吗?
提前致谢。
编辑:添加匿名链接服务 JSON:
{
"name": "LS_P_Oracle_BAS",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"description": "Test",
"annotations": [],
"type": "Oracle",
"typeProperties": {
"connectionString": "host=zzz.net;port=1521;servicename=yyy.com;user id=USER",
"encryptedCredential": "eyJDcmVkZW50aWFsSWQiOiJmZTI3NDU4MS1iNWYyLTQ0YmItYTcwYS0wNzQxZTFkOWY5NTkiLCJWZXJzaW9uIjoiMi4wIiwiQ2xhc3NUeXBlIjoiTWljcm9zb2Z0LkRhdGFQcm94eS5Db3JlLkludGVyU2VydmljZURhdGFDb250cmFjdC5DcmVkZW50aWFsU1UwNkNZMTQifQ=="
},
"connectVia": {
"referenceName": "INTEGRATIONRUNTIME",
"type": "IntegrationRuntimeReference"
}
}
}
EDIT2:使用 Keyvault 的连接配置:
{
"name": "LS_P_Oracle_BAS",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"description": "Test",
"annotations": [],
"type": "Oracle",
"typeProperties": {
"connectionString": "host=yyy.net;port=1521;ServiceName=zzz.com;user id=USER_READER",
"password": {
"type": "AzureKeyVaultSecret",
"store": {
"referenceName": "LS_P_KeyVault_yyy",
"type": "LinkedServiceReference"
},
"secretName": "BAS-reader-password"
}
},
"connectVia": {
"referenceName": "INTEGRATIONRUNTIME",
"type": "IntegrationRuntimeReference"
}
}
}
我在使用第二个链接服务 JSON 时遇到的错误:
The value of the property '' is invalid: 'Format of the initialization string does not conform to specification starting at index 105.'. Format of the initialization string does not conform to specification starting at index 105.
【问题讨论】:
-
我尝试按照您提到的那样创建 Azure SQL 服务器密码(其中包含半列 ;),并且能够毫无问题地创建并连接到 Azure SQL 链接服务。您尝试创建的数据库链接服务是什么?请检查您的端口号是否正确?如果可能,请使用虚拟用户名和密码共享连接字符串(或完整的链接服务 JSON 代码)。还可以尝试使用测试客户端应用程序验证连接字符串,以确保您的连接字符串格式正确。
-
您好,感谢您的回答。我已将链接服务 JSON 代码添加到我的答案中。我尝试使用具有相同凭据、主机名、服务主体、端口号的 Dbeaver 连接到该数据库,并且连接成功。