Build Task - Create Release

Hi Guys

I’m using the Build vNext tasks to upload packages to octopus, and am trying to create a new release with the CreateOctopusRelease vso task, but i’m getting access denied errors when trying to include changeset comments and/or work items as release notes.

The logging is as follows:
2016-06-21T10:37:48.4228925Z Comments = True, WorkItems = True
2016-06-21T10:37:48.4398942Z ##[debug]GET http://tfs:8080/tfs/Random/a1948539-6fd1-4850-9ca9-7bf6b723bec8/_apis/build/builds/20988/changes with 0-byte payload
2016-06-21T10:37:48.4818984Z ##[debug]Leaving C:\TFSAgents\agent01\tasks\OctopusCreateRelease\1.2.1\Octopus-CreateRelease.ps1.
2016-06-21T10:37:48.4848987Z ##[debug]Caught exception from task script.
2016-06-21T10:37:48.4888991Z ##[debug]Error record:
2016-06-21T10:37:48.5409043Z ##[debug]Invoke-WebRequest : Server Error
2016-06-21T10:37:48.5419044Z ##[debug]401 - Unauthorized: Access is denied due to invalid credentials.
2016-06-21T10:37:48.5429045Z ##[debug]You do not have permission to view this directory or page using the credentials that you supplied.
2016-06-21T10:37:48.5439046Z ##[debug]At C:\TFSAgents\agent01\tasks\OctopusCreateRelease\1.2.1\Octopus-CreateRelease.ps1:13 char:21
2016-06-21T10:37:48.5449047Z ##[debug]+ $changesResponse = Invoke-WebRequest -Uri $changesUri -Headers $headers -UseBas …
2016-06-21T10:37:48.5459048Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-06-21T10:37:48.5479050Z ##[debug] + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException
2016-06-21T10:37:48.5559058Z ##[debug] + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe ll.Commands.InvokeWebRequestCommand
2016-06-21T10:37:48.5579060Z ##[debug]Script stack trace:
2016-06-21T10:37:48.5609063Z ##[debug]at Get-LinkedReleaseNotes, C:\TFSAgents\agent01\tasks\OctopusCreateRelease\1.2.1\Octopus-CreateRelease.ps1: line 13
2016-06-21T10:37:48.5619064Z ##[debug]at , C:\TFSAgents\agent01\tasks\OctopusCreateRelease\1.2.1\Octopus-CreateRelease.ps1: line 133
2016-06-21T10:37:48.5639066Z ##[debug]at , : line 1
2016-06-21T10:37:48.5649067Z ##[debug]at , : line 22
2016-06-21T10:37:48.5659068Z ##[debug]at , : line 18
2016-06-21T10:37:48.5669069Z ##[debug]at , : line 1

Hi,

Thanks for reaching out!

Does the account running that Agent have access to reach the workitems? Judging from that error, it seems like it doesn’t

Regards,
Dalmiro

Look like it was a TFS security problem indeed

Thx anyway