{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/comments/132045956","pull_request_review_id":55086301,"id":132045956,"diff_hunk":"@@ -245,42 +394,66 @@ export class EventHubComponent {\n                     })\n                     .subscribe(r => {\n                         this._globalStateService.clearBusyState();\n-                        this.selectItem.next(appSettingName);\n+                        this.selectItem.next(IoTHelper.generateEventHubAppSettingObject(appSettingName, appSettingValue, this.selectedEventHubConsumerGroup));\n                     });\n             }\n         } else {\n-            var appSettingName: string;\n-            var appSettingValue: string;\n-            if (this.option === this.optionTypes.IOTHub && this.selectedIOTHub && this.selectedIOTEndpoint) {\n \n+            if (this.option === this.optionTypes.IOTHub && this.selectedIOTHub && this.selectedIOTEndpoint) {\n                 var IOTHub = this.IOTHubs.value.find(item => (item.id === this.selectedIOTHub));\n-                var IOTEndpoint = this.IOTEndpoints.find(item => (item.value === this.selectedIOTEndpoint));\n \n-                appSettingName = `${IOTHub.name}_${IOTEndpoint.title}_IOTHUB`;\n-                appSettingValue = IOTEndpoint.value;\n+                // appSettingValue\n+                if (this.selectedIOTEndpoint.isBuiltIn) {\n+                    appSettingName = `${IOTHub.name}_${this.selectedIOTEndpoint.name}_IOTHUB_${this.selectedIOTPolicy}`;\n+                    this._cacheService.postArm(this.selectedIOTHub + \"/listkeys\", true, '2017-01-19').subscribe(r => {\n+                        var serviceKey: IOTKey = r.json().value.find(item => (item.keyName === this.selectedIOTPolicy));\n+                        appSettingValue = IoTHelper.changeIOTConnectionStringPolicy(this.selectedIOTEndpoint.value, this.selectedIOTPolicy, serviceKey.primaryKey)\n+                        this.setNonEventHubAppSetting(appSettingName, appSettingValue);\n+                    })\n+                }\n+                else {\n+                    let selectedPolicy = this.getSelectedPolicyFromEventHub(this.selectedIOTPolicy);\n+                    appSettingName = `${IOTHub.name}_${this.selectedIOTEndpoint.name}_IOTHUB_${selectedPolicy}`;\n+                    this._cacheService.postArm(this.selectedIOTPolicy + '/ListKeys', true, \"2015-08-01\")","path":"AzureFunctions.AngularClient/src/app/pickers/event-hub/event-hub.component.ts","position":399,"original_position":399,"commit_id":"ac919d0529b2a16dd97df0b6b05290033cbd7bf3","original_commit_id":"ac919d0529b2a16dd97df0b6b05290033cbd7bf3","user":{"login":"hartra344","id":13208452,"avatar_url":"https://avatars2.githubusercontent.com/u/13208452?v=4","gravatar_id":"","url":"https://api.github.com/users/hartra344","html_url":"https://github.com/hartra344","followers_url":"https://api.github.com/users/hartra344/followers","following_url":"https://api.github.com/users/hartra344/following{/other_user}","gists_url":"https://api.github.com/users/hartra344/gists{/gist_id}","starred_url":"https://api.github.com/users/hartra344/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartra344/subscriptions","organizations_url":"https://api.github.com/users/hartra344/orgs","repos_url":"https://api.github.com/users/hartra344/repos","events_url":"https://api.github.com/users/hartra344/events{/privacy}","received_events_url":"https://api.github.com/users/hartra344/received_events","type":"User","site_admin":false},"body":">\"2015-08-01\" [](start = 91, length = 12)\r\n\r\nsame as above, this should be a constant somewhere","created_at":"2017-08-08T22:06:22Z","updated_at":"2017-08-08T22:06:22Z","html_url":"https://github.com/Azure/azure-functions-ux/pull/1653#discussion_r132045956","pull_request_url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/comments/132045956"},"html":{"href":"https://github.com/Azure/azure-functions-ux/pull/1653#discussion_r132045956"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653","id":134483388,"html_url":"https://github.com/Azure/azure-functions-ux/pull/1653","diff_url":"https://github.com/Azure/azure-functions-ux/pull/1653.diff","patch_url":"https://github.com/Azure/azure-functions-ux/pull/1653.patch","issue_url":"https://api.github.com/repos/Azure/azure-functions-ux/issues/1653","number":1653,"state":"open","locked":false,"title":"new IoT Trigger template","user":{"login":"ElleTojaroon","id":15943485,"avatar_url":"https://avatars2.githubusercontent.com/u/15943485?v=4","gravatar_id":"","url":"https://api.github.com/users/ElleTojaroon","html_url":"https://github.com/ElleTojaroon","followers_url":"https://api.github.com/users/ElleTojaroon/followers","following_url":"https://api.github.com/users/ElleTojaroon/following{/other_user}","gists_url":"https://api.github.com/users/ElleTojaroon/gists{/gist_id}","starred_url":"https://api.github.com/users/ElleTojaroon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElleTojaroon/subscriptions","organizations_url":"https://api.github.com/users/ElleTojaroon/orgs","repos_url":"https://api.github.com/users/ElleTojaroon/repos","events_url":"https://api.github.com/users/ElleTojaroon/events{/privacy}","received_events_url":"https://api.github.com/users/ElleTojaroon/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-07T17:02:39Z","updated_at":"2017-08-08T22:06:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-functions-ux/issues/1653/comments","statuses_url":"https://api.github.com/repos/Azure/azure-functions-ux/statuses/ac919d0529b2a16dd97df0b6b05290033cbd7bf3","head":{"label":"ElleTojaroon:elle","ref":"elle","sha":"ac919d0529b2a16dd97df0b6b05290033cbd7bf3","user":{"login":"ElleTojaroon","id":15943485,"avatar_url":"https://avatars2.githubusercontent.com/u/15943485?v=4","gravatar_id":"","url":"https://api.github.com/users/ElleTojaroon","html_url":"https://github.com/ElleTojaroon","followers_url":"https://api.github.com/users/ElleTojaroon/followers","following_url":"https://api.github.com/users/ElleTojaroon/following{/other_user}","gists_url":"https://api.github.com/users/ElleTojaroon/gists{/gist_id}","starred_url":"https://api.github.com/users/ElleTojaroon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElleTojaroon/subscriptions","organizations_url":"https://api.github.com/users/ElleTojaroon/orgs","repos_url":"https://api.github.com/users/ElleTojaroon/repos","events_url":"https://api.github.com/users/ElleTojaroon/events{/privacy}","received_events_url":"https://api.github.com/users/ElleTojaroon/received_events","type":"User","site_admin":false},"repo":{"id":95698434,"name":"azure-functions-ux","full_name":"ElleTojaroon/azure-functions-ux","owner":{"login":"ElleTojaroon","id":15943485,"avatar_url":"https://avatars2.githubusercontent.com/u/15943485?v=4","gravatar_id":"","url":"https://api.github.com/users/ElleTojaroon","html_url":"https://github.com/ElleTojaroon","followers_url":"https://api.github.com/users/ElleTojaroon/followers","following_url":"https://api.github.com/users/ElleTojaroon/following{/other_user}","gists_url":"https://api.github.com/users/ElleTojaroon/gists{/gist_id}","starred_url":"https://api.github.com/users/ElleTojaroon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElleTojaroon/subscriptions","organizations_url":"https://api.github.com/users/ElleTojaroon/orgs","repos_url":"https://api.github.com/users/ElleTojaroon/repos","events_url":"https://api.github.com/users/ElleTojaroon/events{/privacy}","received_events_url":"https://api.github.com/users/ElleTojaroon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ElleTojaroon/azure-functions-ux","description":"Azure Functions UX","fork":true,"url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux","forks_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/forks","keys_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/teams","hooks_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/hooks","issue_events_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/issues/events{/number}","events_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/events","assignees_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/assignees{/user}","branches_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/branches{/branch}","tags_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/tags","blobs_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/git/refs{/sha}","trees_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/statuses/{sha}","languages_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/languages","stargazers_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/stargazers","contributors_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/contributors","subscribers_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/subscribers","subscription_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/subscription","commits_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/commits{/sha}","git_commits_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/git/commits{/sha}","comments_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/comments{/number}","issue_comment_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/issues/comments{/number}","contents_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/contents/{+path}","compare_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/merges","archive_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/downloads","issues_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/issues{/number}","pulls_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/pulls{/number}","milestones_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/milestones{/number}","notifications_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/labels{/name}","releases_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/releases{/id}","deployments_url":"https://api.github.com/repos/ElleTojaroon/azure-functions-ux/deployments","created_at":"2017-06-28T18:16:10Z","updated_at":"2017-06-28T18:16:12Z","pushed_at":"2017-08-07T16:58:37Z","git_url":"git://github.com/ElleTojaroon/azure-functions-ux.git","ssh_url":"git@github.com:ElleTojaroon/azure-functions-ux.git","clone_url":"https://github.com/ElleTojaroon/azure-functions-ux.git","svn_url":"https://github.com/ElleTojaroon/azure-functions-ux","homepage":"https://functions.azure.com","size":8412,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"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":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"9b9789644bce03a4fefcdf586cbddb2b519a97a9","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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":50877831,"name":"azure-functions-ux","full_name":"Azure/azure-functions-ux","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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-functions-ux","description":"Azure Functions UX","fork":false,"url":"https://api.github.com/repos/Azure/azure-functions-ux","forks_url":"https://api.github.com/repos/Azure/azure-functions-ux/forks","keys_url":"https://api.github.com/repos/Azure/azure-functions-ux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-functions-ux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-functions-ux/teams","hooks_url":"https://api.github.com/repos/Azure/azure-functions-ux/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-functions-ux/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-functions-ux/events","assignees_url":"https://api.github.com/repos/Azure/azure-functions-ux/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-functions-ux/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-functions-ux/tags","blobs_url":"https://api.github.com/repos/Azure/azure-functions-ux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-functions-ux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-functions-ux/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-functions-ux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-functions-ux/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-functions-ux/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-functions-ux/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-functions-ux/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-functions-ux/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-functions-ux/subscription","commits_url":"https://api.github.com/repos/Azure/azure-functions-ux/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-functions-ux/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-functions-ux/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-functions-ux/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-functions-ux/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-functions-ux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-functions-ux/merges","archive_url":"https://api.github.com/repos/Azure/azure-functions-ux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-functions-ux/downloads","issues_url":"https://api.github.com/repos/Azure/azure-functions-ux/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-functions-ux/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-functions-ux/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-functions-ux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-functions-ux/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-functions-ux/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-functions-ux/deployments","created_at":"2016-02-01T23:01:22Z","updated_at":"2017-07-25T18:54:56Z","pushed_at":"2017-08-08T20:57:12Z","git_url":"git://github.com/Azure/azure-functions-ux.git","ssh_url":"git@github.com:Azure/azure-functions-ux.git","clone_url":"https://github.com/Azure/azure-functions-ux.git","svn_url":"https://github.com/Azure/azure-functions-ux","homepage":"https://functions.azure.com","size":9979,"stargazers_count":122,"watchers_count":122,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":169,"forks":41,"open_issues":169,"watchers":122,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653"},"html":{"href":"https://github.com/Azure/azure-functions-ux/pull/1653"},"issue":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/issues/1653"},"comments":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/issues/1653/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/pulls/1653/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-functions-ux/statuses/ac919d0529b2a16dd97df0b6b05290033cbd7bf3"}}}}
{"actor":{"display_login":"hartra344"}}