0

We save all our build packages (conda build) in our jFrog artifactory server as the compressed tar.bz2 file that can be accessed by the URL, username and password. Currently this is done by cURLUploader task shown below

  - task: cURLUploader@2
    displayName: Upload to TTI Artifactory 
    inputs:
      files: '$(Build.ArtifactStagingDirectory)/$(packageName)-$(Build.BuildId).tar.bz2'
      authType: 'userAndPass'
      username: 'admin'
      password: '123'
      url: 'https://artifactory.xyz.com/abc/local/'
      redirectStderr: true

One of the issues is it is hard to control the versioning. Would be nice to have some sort of Major.Minor.Patch instead of the Build.BuildId as part of the compressed file name. I am thinking to use UniversalPakages task to do the job. It request to save the credential in a serviceConnection. And this step faced an issue.

  - task: UniversalPackages@0
    inputs:
      command: publish 
      feedsToUse: external
      externalFeedCredentials: jfrogConnect # Errors appears when creating the service connection
      publishDirectory: '$(Build.ArtifactStagingDirectory)' 
      feedsToUsePublish: external 
      feedPublishExternal: https://artifactory.xyz.com/abc/local/
      packagePublishExternal: $(packageName)
      versionOption: patch
      packagePublishDescription: Upload Package to xyz-local artifactory

When I trying to create the service connection for the jFrog artifactory repo (https://artifactory.xyz-local/noarch/)it returns the error

Failed to query service connection API: 'https://artifactory.xyz-local/noarch/api/plugins'. Error Message: 'An error occurred while sending the request.'

Update: the repo is in our private vNet, the service connection therefore has issues to access this url, I think that's the issues caused this. The question then would be how to create a service connection to access your private resources. The pipeline task is running in our private agent it is able to access the resource. (proved by the cURLUploader task)

SLN
  • 4,772
  • 2
  • 38
  • 79

1 Answers1

1

The question then would be how to create a service connection to access your private resources. The pipeline task is running in our private agent it is able to access the resource. (proved by the cURLUploader task)

Since your jFrog artifactory repo in private resources, it could not be verified from the external network, which will cause the verification to fail.

To resolve this issue, you could try to create the connection with the option Save without verification:

enter image description here

Note: You could only use this connection with your private agent in the same private resources.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135