{"action":"created","issue":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/1436","labels_url":"https://api.github.com/repos/projectkudu/kudu/issues/1436/labels{/name}","comments_url":"https://api.github.com/repos/projectkudu/kudu/issues/1436/comments","events_url":"https://api.github.com/repos/projectkudu/kudu/issues/1436/events","html_url":"https://github.com/projectkudu/kudu/issues/1436","id":54709491,"number":1436,"title":"Webjobs: Improve hosting of custom functions for continous jobs","user":{"login":"bunceg","id":6209708,"avatar_url":"https://avatars.githubusercontent.com/u/6209708?v=3","gravatar_id":"","url":"https://api.github.com/users/bunceg","html_url":"https://github.com/bunceg","followers_url":"https://api.github.com/users/bunceg/followers","following_url":"https://api.github.com/users/bunceg/following{/other_user}","gists_url":"https://api.github.com/users/bunceg/gists{/gist_id}","starred_url":"https://api.github.com/users/bunceg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bunceg/subscriptions","organizations_url":"https://api.github.com/users/bunceg/orgs","repos_url":"https://api.github.com/users/bunceg/repos","events_url":"https://api.github.com/users/bunceg/events{/privacy}","received_events_url":"https://api.github.com/users/bunceg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-18T20:46:31Z","updated_at":"2015-01-18T21:00:16Z","closed_at":"2015-01-18T21:00:16Z","body":"Hi,\r\n\r\nWith the move to microservices and azure websites seemingly being the backbone for a lot of this in the future  IMO the webjob sdk is a little clunky for migrating custom long running back end functionality. I need to declare a job host, then invoke my method via a call method, and then perform a run and block.\r\n\r\nWhen the job host is eventually stopped it appears that I cannot get access to the cancellation token held internally by the job host to perform my own clean up and stop processing, so I am left with running my own cleanup code after the run and block has finished. This doesn't write to any of the dashboard logs or interact wi any of the sdk functionality we want job host for.\r\n\r\nWhat would be helpful is an event or some means for me to hook into the job host pipeline so that I can intercept stages in the pipeline and inject my own functionality, e.g. On starting, on started, on stopping, on stopped etc.\r\n\r\nI could write my own implementation of the job host that hooks into the notification file etc, but the sdk is the recommended way to use web jobs as it provides better integration with the azure website framework; it's just that all the focus for it seems to be on using it for queues, blobs etc using the sdk methods whereas trying to move brownfield functionality to the webjob architecture means moving a lot of custom code with minimal change from what is, effectively, an on-premise windows service or azure worker role is highly attractive, and this appears to be harder than it could be.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/comments/70425670","html_url":"https://github.com/projectkudu/kudu/issues/1436#issuecomment-70425670","issue_url":"https://api.github.com/repos/projectkudu/kudu/issues/1436","id":70425670,"user":{"login":"davidebbo","id":556238,"avatar_url":"https://avatars.githubusercontent.com/u/556238?v=3","gravatar_id":"","url":"https://api.github.com/users/davidebbo","html_url":"https://github.com/davidebbo","followers_url":"https://api.github.com/users/davidebbo/followers","following_url":"https://api.github.com/users/davidebbo/following{/other_user}","gists_url":"https://api.github.com/users/davidebbo/gists{/gist_id}","starred_url":"https://api.github.com/users/davidebbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidebbo/subscriptions","organizations_url":"https://api.github.com/users/davidebbo/orgs","repos_url":"https://api.github.com/users/davidebbo/repos","events_url":"https://api.github.com/users/davidebbo/events{/privacy}","received_events_url":"https://api.github.com/users/davidebbo/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T21:00:16Z","updated_at":"2015-01-18T21:00:16Z","body":"Valid topic, but not the right place to bring it up as the WebJobs SDK is not part of Kudu. Could you post to the [Websites Forum](https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=windowsazurewebsitespreview) instead? I'll make sure to point the right SDK people to it so they can respond. Thanks!"}}