Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Feb 03, 2015 @ 11:55
    Warren Buckley
    0

    Using Umbraco with Azure WebJobs

    Hello all,
    I am currently in the process of rebuilding uHangout.co.uk website that heavily relies on the YouTube API.

    My thought with the new site is not to use YouTube's direct API feed to power the website but to use an Azure WebJob to poll the YouTube API say once an hour and use the WebJob to import nodes into Umbraco, so extra meta information can be added that YouTube does not allow me to specify.

    With this extra meta information stored on videos will make for much better searching using Examine to help people find the videos that they are looking for.

    So I have no experience and very little understanding of how WebJobs works but from my limited knowledge I understand that there are two types. Queue based with a continuous running application listening for items in the queue or to use an application that runs and stops on a scheduled basis.

    The scheduled WebJob approach is what I want to try and achieve. So Azure WebJobs are basically console applications under the hood. I need to know how I can use the Umbraco Service APIs in a console application to allow me to create and publish content nodes in my site.

    If it is not possible my other thought, but seems a bit hacky/messy is to get the console application to do a HTTP POST to an Umbraco WebAPI route which then will allow me easily to then take the data and create the content node with the services as I will have a HTTP context.

    So I would love to hear your thoughts on this and what could be done to help solve my problem of moving the constant polling of YouTube's APIs to less frequently and storing extra meta data in content nodes for better searching.

    Cheers,
    Warren :)

  • Tom Steer 161 posts 596 karma points
    Feb 03, 2015 @ 13:28
    Tom Steer
    0

    Hey Warren,

    Not worked with Azure WebJobs before so can't give any input on that but would this be of any help for the console application, should give you a good idea of how to create content etc.

    https://github.com/sitereactor/umbraco-console-example

    Cheers,

    Tom

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 03, 2015 @ 16:07
    Morten Christensen
    100

    Hey Warren,

    I think you will be much better off exposing an api endpoint of some kind within your Umbraco website (secure of course), and then call that from your WebJob. It'll be much easier to deal with then creating a console app that uses the Content Service API outside the context of Umbraco.

    Hope this helps,

    Morten Christensen

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Feb 03, 2015 @ 16:31
    Warren Buckley
    0

    Hey Morten,
    I think you are probably right when with the advice and go with a WebAPI POST endpoint with some authentication on it.

    Will make life a lot easier for sure, as I would not have a clue where to start with the pure console application method.

    Cheers,
    Warren :)

  • ianhoughton 281 posts 605 karma points c-trib
    Feb 03, 2015 @ 17:36
    ianhoughton
    1

    Hi Warren,

    I would agree on the WebAPI route. I've created a console app in the past that took an external xml feed, posted the data to umbraco via the api, and then created / deleted the nodes required. I did try doing it all from inside the console app but never got past the umbraco context issues.

    Cheers Ian

  • Carl Bussema 38 posts 140 karma points
    May 05, 2016 @ 17:06
    Carl Bussema
    0

    I know this is an old thread, but I just started looking into this myself. Is it still the best idea to just use a WebAPI call with some authentication? It's a little annoying; I'd prefer to just run it all from the background thread of the webjob, but if it's going to be a hassle, I guess I can just do it from the main application.

Please Sign in or register to post replies

Write your reply to:

Draft