问题描述
对于CDS链接服务,无法(从UI)引入参数。但! Microsoft确实在“高级”设置中为我们提供了方便的“以Json格式指定动态内容”复选框。
有人有这样的示例来转换标准链接服务json:
{
"name": "cdsCorpPlan","type": "Microsoft.DataFactory/factories/linkedservices","properties": {
"annotations": [],"type": "CommonDataServiceForApps","typeProperties": {
"deploymentType": "Online","serviceUri": "https://blahblah-dev.crm.dynamics.com","authenticationType": "AADServicePrincipal","servicePrincipalCredentialType": "ServicePrincipalKey","servicePrincipalId": "xxx-xxx-xxx-xxx-xxxxxxxx","encryptedCredential": "ew0KICAiVmVyc2lvbiI6ICIyMDE3LTExLTMwIiwNCiAgIlByb3RlY3Rpb25Nb2RlIjogIktleSIsDQogICJTZWNyZXRDb250ZW50VHlwZSI6ICJQbGFpbnRleHQiLA0KICAiQ3JlZGVudGlhbElkIjogIkFERi1MUC1PUkNIRVNUUkFUT1ItREVWX2M0MDYzYjEzLTBkNjYtNDQ2Yi04NjFkLTYyYjJkNjI1MjNlYiINCn0="
}
}
}
转换为准解密版本?
具体来说,如果我想参数化 serviceUri 和服务主体键,语法将是什么?
解决方法
我想我明白了。对于那些您感兴趣的人:
{
"name": "cdsCorpPlanTCO","properties": {
"parameters": {
"SecretName": {
"type": "string"
}
},"type": "CommonDataServiceForApps","typeProperties": {
"deploymentType": "Online","serviceUri": {
"type": "AzureKeyVaultSecret","store": {
"referenceName": "MyKeyVault","type": "LinkedServiceReference"
},"secretName": {
"value": "@linkedService().SecretName","type": "Expression"
}
},"authenticationType": "AADServicePrincipal","servicePrincipalCredentialType": "ServicePrincipalKey","servicePrincipalId": "xxxx-xxxx-xxxx-xxxx-xxxxxxxx","servicePrincipalCredential": {
"type": "AzureKeyVaultSecret","secretName": "SPkey"
}
},"annotations": []
},"type": "Microsoft.DataFactory/factories/linkedservices"
}