{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments/91567417","pull_request_review_id":12077368,"id":91567417,"diff_hunk":"@@ -0,0 +1,93 @@\n+﻿Param([switch] $Preview) \n+\n+# You can set up these values to your desired test environment,\n+# or leave them blank to be prompted\n+$subscriptionName = \"\"\n+$batchAcctName = \"\"\n+$storageAcctName = \"\"\n+$storageAcctRG = \"\"\n+\n+# You only need to change these if testing against a Microsoft\n+# internal test environment\n+$managementUrl = \"https://management.azure.com/\"\n+$testTenantCertificateThumbprint = \"***UNUSED***\"\n+\n+$promptKeys = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()\"  # there are undoubtedly cleaner ways to do this, but not worth investing in for a quick setup script\n+\n+function SetEnv([string] $name, [string] $value)\n+{\n+  if ($Preview)\n+  {\n+    [Console]::WriteLine(\"{0} => {1}\", $name, $value)\n+  }\n+  else\n+  {\n+    [Environment]::SetEnvironmentVariable($name, $value, \"User\")\n+  }\n+}\n+\n+function PromptSelect($resourceType, $values, $getName)\n+{\n+  if ($values.Count -le $promptKeys.Length)\n+  {\n+    # this mutates the values which is not great but should not be an issue for this script\n+    $choices_ = $values | foreach {$i=0} {$_ | Add-Member PromptKey ($promptKeys[$i++]) -PassThru -Force} | ForEach-Object { New-Object System.Management.Automation.Host.ChoiceDescription([String]::Format(\"&{0}: {1}\", $_.PromptKey, $getName.Invoke($_)[0]), $getName.Invoke($_)[0])}\n+    $choices = [System.Management.Automation.Host.ChoiceDescription[]]($choices_)\n+    $selectedIndex = $host.ui.PromptForChoice(\"Choose the \" + $resourceType + \" to use\", \"\", $choices, 0)\n+    $values[$selectedIndex]\n+  }\n+  else\n+  {\n+    throw \"Too many \" + $resourceType + \" objects to prompt from - set the relevant script variable instead\"\n+  }\n+}\n+\n+Login-AzureRmAccount\n+\n+if ([String]::IsNullOrEmpty($subscriptionName))\n+{\n+  $subs = Get-AzureRmSubscription\n+  $sub = PromptSelect \"subscription\" $subs { Param($s) $s.SubscriptionName }\n+  $subscriptionName = $sub.SubscriptionName\n+}\n+Select-AzureRmSubscription -SubscriptionName $subscriptionName\n+\n+if ([String]::IsNullOrEmpty($batchAcctName))\n+{\n+  $bas = Get-AzureRmBatchAccount\n+  $batchAcct_ = PromptSelect \"Batch account\" $bas { Param($b) [String]::Format(\"{0}/{1}\", $b.AccountName, $b.Location) }\n+  $batchAcct = Get-AzureRmBatchAccountKeys $batchAcct_.AccountName -ResourceGroupName $batchAcct_.ResourceGroupName\n+}\n+else\n+{\n+  $batchAcct = Get-AzureRmBatchAccountKeys $batchAcctName\n+}\n+\n+if ([String]::IsNullOrEmpty($storageAcctName))\n+{\n+  $sas = Get-AzureRmStorageAccount\n+  $storageAcct = PromptSelect \"Storage account\" $sas { Param($s) $s.StorageAccountName }\n+  $storageAcctName = $storageAcct.StorageAccountName\n+  $storageAcctRG = $storageAcct.ResourceGroupName\n+}\n+else\n+{\n+  $storageAcct = Get-AzureRmStorageAccount $storageAcctRG $storageAcctName\n+}\n+$storageKeys = Get-AzureRmStorageAccountKey $storageAcctRG $storageAcctName\n+$blobEndpoint = $storageAcct.PrimaryEndpoints.Blob\n+\n+SetEnv \"MABOM_BatchAccountSubscriptionId\" $batchAcct.Subscription\n+SetEnv \"MABOM_BatchManagementEndpoint\" $managementUrl\n+\n+SetEnv \"MABOM_BatchAccountName\" $batchAcct.AccountName\n+SetEnv \"MABOM_BatchAccountKey\" $batchAcct.PrimaryAccountKey\n+SetEnv \"MABOM_BatchAccountEndpoint\" $batchAcct.TaskTenantUrl\n+SetEnv \"MABOM_BatchAccountResourceGroupName\" $batchAcct.ResourceGroupName\n+\n+SetEnv \"MABOM_StorageAccount\" $storageAcctName\n+SetEnv \"MABOM_StorageKey\" $storageKeys[0].Value\n+SetEnv \"MABOM_BlobEndpoint\" $blobEndpoint\n+SetEnv \"MABOM_StorageAccountResourceGroupName\" $storageAcctRG\n+\n+SetEnv \"MABOM_BatchTRPCertificateThumbprint\" $testTenantCertificateThumbprint","path":"src/Batch/SetupBatchIntegrationTestEnvironment.ps1","position":96,"original_position":93,"commit_id":"39b6492442ee2563035cd7c67af3d4dff691857e","original_commit_id":"fa328387f2974b9bdbc09ec2dac333104b422772","user":{"login":"matthchr","id":8798850,"avatar_url":"https://avatars.githubusercontent.com/u/8798850?v=3","gravatar_id":"","url":"https://api.github.com/users/matthchr","html_url":"https://github.com/matthchr","followers_url":"https://api.github.com/users/matthchr/followers","following_url":"https://api.github.com/users/matthchr/following{/other_user}","gists_url":"https://api.github.com/users/matthchr/gists{/gist_id}","starred_url":"https://api.github.com/users/matthchr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthchr/subscriptions","organizations_url":"https://api.github.com/users/matthchr/orgs","repos_url":"https://api.github.com/users/matthchr/repos","events_url":"https://api.github.com/users/matthchr/events{/privacy}","received_events_url":"https://api.github.com/users/matthchr/received_events","type":"User","site_admin":false},"body":"Just remove this one too then (the `TRPCertThumbprint` one)?\r\n\r\nThe one is useless without the other (you need both to run on a test env)","created_at":"2016-12-08T17:48:02Z","updated_at":"2016-12-08T17:48:02Z","html_url":"https://github.com/Azure/azure-sdk-for-net/pull/2623#discussion_r91567417","pull_request_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments/91567417"},"html":{"href":"https://github.com/Azure/azure-sdk-for-net/pull/2623#discussion_r91567417"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623","id":97024730,"html_url":"https://github.com/Azure/azure-sdk-for-net/pull/2623","diff_url":"https://github.com/Azure/azure-sdk-for-net/pull/2623.diff","patch_url":"https://github.com/Azure/azure-sdk-for-net/pull/2623.patch","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/2623","number":2623,"state":"open","locked":false,"title":"Script for setting up environment variables for Batch integration tests","user":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-07T22:53:26Z","updated_at":"2016-12-08T17:48:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3131b6b3e538c1b9dcbd466304ee634c41d58706","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/2623/comments","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/39b6492442ee2563035cd7c67af3d4dff691857e","head":{"label":"itowlson:batch/feature/integration-test-setup","ref":"batch/feature/integration-test-setup","sha":"39b6492442ee2563035cd7c67af3d4dff691857e","user":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"repo":{"id":56563170,"name":"azure-sdk-for-net","full_name":"itowlson/azure-sdk-for-net","owner":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/itowlson/azure-sdk-for-net","description":"Microsoft Azure SDK for .NET","fork":true,"url":"https://api.github.com/repos/itowlson/azure-sdk-for-net","forks_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/forks","keys_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/teams","hooks_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/hooks","issue_events_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/issues/events{/number}","events_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/events","assignees_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/assignees{/user}","branches_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/branches{/branch}","tags_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/tags","blobs_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/git/refs{/sha}","trees_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/statuses/{sha}","languages_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/languages","stargazers_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/stargazers","contributors_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/contributors","subscribers_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/subscribers","subscription_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/subscription","commits_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/commits{/sha}","git_commits_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/git/commits{/sha}","comments_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/comments{/number}","issue_comment_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/issues/comments{/number}","contents_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/contents/{+path}","compare_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/merges","archive_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/downloads","issues_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/issues{/number}","pulls_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/pulls{/number}","milestones_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/milestones{/number}","notifications_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/labels{/name}","releases_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/releases{/id}","deployments_url":"https://api.github.com/repos/itowlson/azure-sdk-for-net/deployments","created_at":"2016-04-19T03:55:06Z","updated_at":"2016-04-19T03:55:28Z","pushed_at":"2016-12-08T17:36:10Z","git_url":"git://github.com/itowlson/azure-sdk-for-net.git","ssh_url":"git@github.com:itowlson/azure-sdk-for-net.git","clone_url":"https://github.com/itowlson/azure-sdk-for-net.git","svn_url":"https://github.com/itowlson/azure-sdk-for-net","homepage":"http://www.windowsazure.com/en-us/develop/net/","size":121037,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"Azure:AutoRest","ref":"AutoRest","sha":"403d22184bb260ceb6a20c5426dd91ce815be3e5","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":2928944,"name":"azure-sdk-for-net","full_name":"Azure/azure-sdk-for-net","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-sdk-for-net","description":"Azure Tools for VIsual Studio","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-net","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/deployments","created_at":"2011-12-06T23:32:47Z","updated_at":"2016-12-08T16:35:47Z","pushed_at":"2016-12-08T17:44:19Z","git_url":"git://github.com/Azure/azure-sdk-for-net.git","ssh_url":"git@github.com:Azure/azure-sdk-for-net.git","clone_url":"https://github.com/Azure/azure-sdk-for-net.git","svn_url":"https://github.com/Azure/azure-sdk-for-net","homepage":"https://www.visualstudio.com/features/azure-tools-vs","size":205523,"stargazers_count":851,"watchers_count":851,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":696,"mirror_url":null,"open_issues_count":178,"forks":696,"open_issues":178,"watchers":851,"default_branch":"AutoRest"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623"},"html":{"href":"https://github.com/Azure/azure-sdk-for-net/pull/2623"},"issue":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/2623"},"comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/2623/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/2623/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/39b6492442ee2563035cd7c67af3d4dff691857e"}}}}
{"actor":{"display_login":"matthchr"}}