I am exploring the azure artifacts service provided by azure devops. I have created a simple c++ helloworld program, which gets compiled and stores the executable in another folder.
To understand how the publishing to azure artifact works, I have copied the executable to the artifact directory, and I call the task to upload the artifact.
Below is the pipeline:
steps:
- script: |
mkdir output
g++ tests.cpp -o output/test
cd output
ls -l
./test
- task: CopyFiles@2
inputs:
Contents: 'output/**'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'testproject'
publishLocation: 'Container'
- task: UniversalPackages@0
displayName: Universal Publish
inputs:
command: publish
publishDirectory: '$(Build.ArtifactStagingDirectory)'
feedsToUsePublish: 'internal'
vstsFeedPublish: 'Department/E-S-S-Test'
vstsFeedPackagePublish: 'testproject'
packagePublishDescription: 'containstestdescription'
versionPublish: '1.0.0'
I am getting the following error :
##[warning]Could not create provenance session: %s
##[warning]Cannot read properties of null (reading 'sessionId')
##[error]Error: Failed to get package versions
##[error]Packages failed to publish
I checked into feed settings, there is a contributor access given to Project Collection Build service group.
What is going wrong here?
>Solution :
Probably you may need provide the ProjectID /FeedID in the vstsFeedPublish