{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/63445905","id":63445905,"diff_hunk":"@@ -455,6 +430,44 @@ private Collection<FunctionDescriptor> ReadFunctions(ScriptHostConfiguration con\n             return ReadFunctions(metadatas, descriptorProviders);\n         }\n \n+        /// <summary>\n+        /// Determines which script should be considered the \"primary\" entry point script.\n+        /// </summary>\n+        internal static string DeterminePrimaryScriptFile(JObject functionConfig, string[] functionFiles)\n+        {\n+            if (functionFiles.Length == 1)\n+            {\n+                // if there is only a single file, that file is primary\n+                return functionFiles[0];\n+            }\n+            else\n+            {\n+                // First see if there is an explicit primary file indicated\n+                // in config. If so use that.\n+                string functionPrimary = null;\n+                string scriptFileName = (string)functionConfig[\"scriptFile\"];\n+                if (!string.IsNullOrEmpty(scriptFileName))\n+                {\n+                    // allow the config file to contain just the file name, or file name\n+                    // with extension\n+                    scriptFileName = Path.GetFileNameWithoutExtension(scriptFileName);\n+\n+                    functionPrimary = functionFiles.FirstOrDefault(p =>\n+                        string.Compare(Path.GetFileNameWithoutExtension(p), scriptFileName, StringComparison.OrdinalIgnoreCase) == 0);","path":"src/WebJobs.Script/Host/ScriptHost.cs","position":null,"original_position":94,"commit_id":"480543601aeae348b3d26ad154a303ced4bf1eba","original_commit_id":"984a78945de96db98232570d19c1d4686a8cb4d2","user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2016-05-16T23:53:13Z","updated_at":"2016-05-16T23:53:13Z","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352#discussion_r63445905","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/63445905"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352#discussion_r63445905"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352","id":70076697,"html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352","diff_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/352","number":352,"state":"open","locked":false,"title":"Rename Source metadata property, clean up resolution logic (#351)","user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"body":"Addresses bug# https://github.com/Azure/azure-webjobs-sdk-script/issues/351\r\n\r\nAlso improving the error message we give when we can't determine the primary script file. As David indicated in the bug, Kudu is using this exact same logic. The plan is to copy this updated function to Kudu as well, and release these updates together.\r\n\r\n@davidebbo @ahmelsayed","created_at":"2016-05-14T00:57:22Z","updated_at":"2016-05-16T23:53:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/352/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/480543601aeae348b3d26ad154a303ced4bf1eba","head":{"label":"Azure:mathewc-dev","ref":"mathewc-dev","sha":"480543601aeae348b3d26ad154a303ced4bf1eba","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":42548553,"name":"azure-webjobs-sdk-script","full_name":"Azure/azure-webjobs-sdk-script","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-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/deployments","created_at":"2015-09-15T21:48:19Z","updated_at":"2016-05-16T04:56:18Z","pushed_at":"2016-05-16T23:52:06Z","git_url":"git://github.com/Azure/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk-script.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk-script.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk-script","homepage":"","size":15024,"stargazers_count":55,"watchers_count":55,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":78,"forks":30,"open_issues":78,"watchers":55,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"0a2165f3536a5dad9060b1741c794ee6c0194c15","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":42548553,"name":"azure-webjobs-sdk-script","full_name":"Azure/azure-webjobs-sdk-script","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-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/deployments","created_at":"2015-09-15T21:48:19Z","updated_at":"2016-05-16T04:56:18Z","pushed_at":"2016-05-16T23:52:06Z","git_url":"git://github.com/Azure/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk-script.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk-script.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk-script","homepage":"","size":15024,"stargazers_count":55,"watchers_count":55,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":78,"forks":30,"open_issues":78,"watchers":55,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/352"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/352"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/480543601aeae348b3d26ad154a303ced4bf1eba"}}}}