简体   繁体   中英

How to pass in client Certificate parameter when creating service fabric connection azure devops REST API

I am attempting to create a service fabric connection via the azure devops rest API, as documented here:

https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/create?view=azure-devops-rest-6.0

When attempting to define the authorization parameters, I have the following fields in my request:

    "authorization": {
    "parameters":{
        "certlookup":"Thumbprint",
        "servercertthumbprint": "{{certificateThumbprint}}",
        "certificate":"{{certname}}",
        "certificatepassword":null,
    },
    "scheme":"certificate"
},

This will create a service connection to the cluster, however it does not look like the 'client certificate' parameter (as shown in screenshot bellow) is parsed in anyhwhere. I also cant seem to find anywhere in the documentation that says how to do this.

How can I pass in the "Client Certificate" Value when using the REST API?

在此处输入图像描述

Below is the detailed view of the parameters which you can use for creating Service Fabric Service Connection :

在此处输入图像描述

Pls try to make your request like below (un tested) to make it work:

 "authorization": {
    "parameters":{
        "certlookup":"Thumbprint",
        "servercertthumbprint": "{{certificateThumbprint}}",
        "clientcertificatedata":"{{certname}}",
        "password":null,
    },
    "scheme":"certificate"
},

Please refer to EndpointAuthorizationParameters Class for details about the parameters to use.

The correct parameter to specify this value is actually just "certificate".

The original request posted is correct, I was entering the name of the certificate rather than the encoding of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM