{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/55516108","id":55516108,"diff_hunk":"@@ -145,10 +145,10 @@ if($azureWebSite) {\n             }\n         }\n         \n-        $deploymentId = Get-TaskVariable $distributedTaskContext \"build.sourceVersion\" #let's use commitId as unique deploymentId in build context\n+        $deploymentId = Get-TaskVariable $distributedTaskContext \"release.releaseUri\" #let's use releaseUri as unique deploymentId in release context\n         if([string]::IsNullOrEmpty($deploymentId)) {\n-            $deploymentId = Get-TaskVariable $distributedTaskContext \"release.releaseUri\" #let's use releaseUri as unique deploymentId in release context\n-        }        \n+            $deploymentId = Get-TaskVariable $distributedTaskContext \"build.sourceVersion\" #let's use commitId as unique deploymentId in build context","path":"Tasks/AzureWebPowerShellDeployment/Publish-AzureWebDeployment.ps1","position":9,"original_position":9,"commit_id":"8c3bc9a0214b6b77da1e7c1e27ac8e3a37788800","original_commit_id":"8c3bc9a0214b6b77da1e7c1e27ac8e3a37788800","user":{"login":"kmkumaran","id":11780076,"avatar_url":"https://avatars.githubusercontent.com/u/11780076?v=3","gravatar_id":"","url":"https://api.github.com/users/kmkumaran","html_url":"https://github.com/kmkumaran","followers_url":"https://api.github.com/users/kmkumaran/followers","following_url":"https://api.github.com/users/kmkumaran/following{/other_user}","gists_url":"https://api.github.com/users/kmkumaran/gists{/gist_id}","starred_url":"https://api.github.com/users/kmkumaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmkumaran/subscriptions","organizations_url":"https://api.github.com/users/kmkumaran/orgs","repos_url":"https://api.github.com/users/kmkumaran/repos","events_url":"https://api.github.com/users/kmkumaran/events{/privacy}","received_events_url":"https://api.github.com/users/kmkumaran/received_events","type":"User","site_admin":false},"body":"Do you want to use build.buildUri instead of sourceVersion?","created_at":"2016-03-09T13:21:16Z","updated_at":"2016-03-09T13:21:16Z","html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/1312#discussion_r55516108","pull_request_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/55516108"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/1312#discussion_r55516108"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312","id":60897400,"html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/1312","diff_url":"https://github.com/Microsoft/vso-agent-tasks/pull/1312.diff","patch_url":"https://github.com/Microsoft/vso-agent-tasks/pull/1312.patch","issue_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/1312","number":1312,"state":"open","locked":false,"title":"Fixed problem setting deployment Id","user":{"login":"dylan-smith","id":1508559,"avatar_url":"https://avatars.githubusercontent.com/u/1508559?v=3","gravatar_id":"","url":"https://api.github.com/users/dylan-smith","html_url":"https://github.com/dylan-smith","followers_url":"https://api.github.com/users/dylan-smith/followers","following_url":"https://api.github.com/users/dylan-smith/following{/other_user}","gists_url":"https://api.github.com/users/dylan-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylan-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylan-smith/subscriptions","organizations_url":"https://api.github.com/users/dylan-smith/orgs","repos_url":"https://api.github.com/users/dylan-smith/repos","events_url":"https://api.github.com/users/dylan-smith/events{/privacy}","received_events_url":"https://api.github.com/users/dylan-smith/received_events","type":"User","site_admin":false},"body":"It appears the intention was to use the Commit Id when running this task from a build, and the Release URI when running from a release.  The problem is the logic was a little off.  It was assuming the build.sourceVersion would be empty when running from a release, but that's not true (at least not if you have a release definition that is linked to a build).\r\n\r\nChanged it to first check if releaseUri is set and if so use that for deploymentId (this should not be set in a build context), and if not then use the build.sourceVersion as the deployment Id.\r\n\r\nRelated to Issue #1311","created_at":"2016-02-26T20:14:56Z","updated_at":"2016-03-09T13:21:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9e012c37eea6574bee134f36d40f6c95dc4ad9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/1312/comments","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/8c3bc9a0214b6b77da1e7c1e27ac8e3a37788800","head":{"label":"dylan-smith:patch-2","ref":"patch-2","sha":"8c3bc9a0214b6b77da1e7c1e27ac8e3a37788800","user":{"login":"dylan-smith","id":1508559,"avatar_url":"https://avatars.githubusercontent.com/u/1508559?v=3","gravatar_id":"","url":"https://api.github.com/users/dylan-smith","html_url":"https://github.com/dylan-smith","followers_url":"https://api.github.com/users/dylan-smith/followers","following_url":"https://api.github.com/users/dylan-smith/following{/other_user}","gists_url":"https://api.github.com/users/dylan-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylan-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylan-smith/subscriptions","organizations_url":"https://api.github.com/users/dylan-smith/orgs","repos_url":"https://api.github.com/users/dylan-smith/repos","events_url":"https://api.github.com/users/dylan-smith/events{/privacy}","received_events_url":"https://api.github.com/users/dylan-smith/received_events","type":"User","site_admin":false},"repo":{"id":52467719,"name":"vso-agent-tasks","full_name":"dylan-smith/vso-agent-tasks","owner":{"login":"dylan-smith","id":1508559,"avatar_url":"https://avatars.githubusercontent.com/u/1508559?v=3","gravatar_id":"","url":"https://api.github.com/users/dylan-smith","html_url":"https://github.com/dylan-smith","followers_url":"https://api.github.com/users/dylan-smith/followers","following_url":"https://api.github.com/users/dylan-smith/following{/other_user}","gists_url":"https://api.github.com/users/dylan-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylan-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylan-smith/subscriptions","organizations_url":"https://api.github.com/users/dylan-smith/orgs","repos_url":"https://api.github.com/users/dylan-smith/repos","events_url":"https://api.github.com/users/dylan-smith/events{/privacy}","received_events_url":"https://api.github.com/users/dylan-smith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dylan-smith/vso-agent-tasks","description":"Build and Release Tasks for Visual Studio Online and Team Foundation Server","fork":true,"url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks","forks_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/dylan-smith/vso-agent-tasks/deployments","created_at":"2016-02-24T19:14:09Z","updated_at":"2016-02-24T19:14:16Z","pushed_at":"2016-03-08T17:14:36Z","git_url":"git://github.com/dylan-smith/vso-agent-tasks.git","ssh_url":"git@github.com:dylan-smith/vso-agent-tasks.git","clone_url":"https://github.com/dylan-smith/vso-agent-tasks.git","svn_url":"https://github.com/dylan-smith/vso-agent-tasks","homepage":" https://www.visualstudio.com/features/devops-vs","size":7559,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"fcb69aeefae74da20990fc0a49882131e1a99438","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vso-agent-tasks","full_name":"Microsoft/vso-agent-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent-tasks","description":"Build and Release Tasks for Visual Studio Online and Team Foundation Server","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","forks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/deployments","created_at":"2014-12-06T11:11:46Z","updated_at":"2016-03-08T19:25:29Z","pushed_at":"2016-03-09T12:23:35Z","git_url":"git://github.com/Microsoft/vso-agent-tasks.git","ssh_url":"git@github.com:Microsoft/vso-agent-tasks.git","clone_url":"https://github.com/Microsoft/vso-agent-tasks.git","svn_url":"https://github.com/Microsoft/vso-agent-tasks","homepage":" https://www.visualstudio.com/features/devops-vs","size":8453,"stargazers_count":267,"watchers_count":267,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":170,"forks":198,"open_issues":170,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/1312"},"issue":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/1312"},"comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/1312/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/1312/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/8c3bc9a0214b6b77da1e7c1e27ac8e3a37788800"}}}}