【问题标题】:How to pass in client Certificate parameter when creating service fabric connection azure devops REST API创建服务结构连接时如何传递客户端证书参数 azure devops REST API
【发布时间】:2021-06-18 16:47:13
【问题描述】:

我正在尝试通过 azure devops rest API 创建服务结构连接,如下所述:

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

在尝试定义授权参数时,我的请求中有以下字段:

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

这将创建到集群的服务连接,但它看起来不像在任何地方解析“客户端证书”参数(如下面的屏幕截图所示)。我似乎也无法在文档中找到说明如何执行此操作的任何地方。

使用 REST API 时如何传入“客户端证书”值?

【问题讨论】:

    标签: azure rest devops azure-service-fabric


    【解决方案1】:

    下面是可用于creating Service Fabric Service Connection 的参数的详细视图:

    请尝试如下提出您的请求(未经测试)以使其正常工作:

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

    具体使用参数请参考EndpointAuthorizationParameters Class

    【讨论】:

    • 遗憾的是这似乎不起作用,我收到以下错误:"Following fields in the service connection are not expected: clientcertificatedata.\r\nOnly fields that are defined in the service connection's contribution type as inputs can be specified.",
    • 你可以试试clientcertificate吗?
    • 正确的参数是“证书”。
    • 如果此答案帮助您识别参数含义并引导您走向正确的方向,您能否将其标记为帮助其他社区成员的答案?
    【解决方案2】:

    指定此值的正确参数实际上只是“证书”。

    发布的原始请求是正确的,我输入的是证书的名称而不是它的编码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-25
      • 2020-01-06
      • 2017-02-03
      • 1970-01-01
      • 2020-07-08
      • 1970-01-01
      • 2019-03-14
      相关资源
      最近更新 更多