【问题标题】:VSTS Service Endpoint with validation link带有验证链接的 VSTS 服务端点
【发布时间】:2018-01-16 14:07:08
【问题描述】:

您好,我创建了一个读取此VSTS Service EndPoint Tutorial 的服务端点,并且创建成功。 当我看到詹金斯端点时,它有一个验证链接来验证端点 我用谷歌搜索了太多样本,但没有相关信息。任何人都可以帮助实现这一目标。

【问题讨论】:

  • 我没有看问题?验证连接后会发生什么?
  • 据我了解,您希望自定义端点具有相同的“验证连接”功能。如果是这种情况,那么此链接可能会对您有所帮助:blogs.msdn.microsoft.com/sriramb/2016/09/15/…。向下滚动到名为“测试服务端点”的最后一段。不过我自己从未尝试过。

标签: azure-devops azure-pipelines-release-pipeline azure-pipelines-build-task


【解决方案1】:

需要在vss-extension.json文件中添加TestConnection名称的数据源,例如:

{
      "id": "service-endpoint",
      "description": "Service Endpoint type for Fabrikam connections",
      "type": "ms.vss-endpoint.service-endpoint-type",
      "targets": [ "ms.vss-endpoint.endpoint-types" ],
      "properties": {
        "name": "fabrikam",
        "displayName": "Fabrikam server connection",
        "url": {
          "displayName": "Server Url",
          "helpText": "Url for the Fabrikam server to connect to."
        },
        "dataSources": [
          { 
              "name": "TestConnection",
              "endpointUrl": "{{endpoint.url}}api/projects/index",
              "resultSelector": "jsonpath:$[*].nm" 
          },
          {
            "name": "Fabrikam Projects",
            "endpointUrl": "{{endpoint.url}}api/projects/index",
            "resultSelector": "jsonpath:$[*].nm"
          }

        ],
        "authenticationSchemes": [
          {
            "type": "ms.vss-endpoint.endpoint-auth-scheme-token"
          },
          {
            "type": "ms.vss-endpoint.endpoint-auth-scheme-basic",
            "inputDescriptors": [
              {
                "id": "username",
                "name": "Username",
                "description": "Username",
                "inputMode": "textbox",
                "validation": {
                  "isRequired": false,
                  "dataType": "string"
                }
              },
              {
                "id": "password",
                "name": "Password",
                "description": "Password",
                "inputMode": "passwordbox",
                "isConfidential": true,
                "validation": {
                  "isRequired": false,
                  "dataType": "string"
                }
              }
            ]
          }

        ],
        "helpMarkDown": "<a href=\"url-to-documentation\" target=\"_blank\"><b>Learn More</b></a>"
      }
    }

【讨论】:

  • 嘿伟大的解决方案,荣誉
猜你喜欢
  • 2018-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多