0

对于 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="
        }
    }
}

成参数化版本?

具体来说,如果我想参数化serviceUriservice principal key的语法是什么?

4

1 回答 1

0

我想我想通了。对于那些有兴趣的人:

{
    "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",
                "store": {
                    "referenceName": "MyKeyVault",
                    "type": "LinkedServiceReference"
                },
                "secretName": "SPkey"
            }
        },
        "annotations": []
    },
    "type": "Microsoft.DataFactory/factories/linkedservices"
}
于 2020-11-11T20:52:10.923 回答