Your SlideShare is downloading. ×
Cut your hair and get an azure webjob
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cut your hair and get an azure webjob

171
views

Published on

Doing unholy things in your Azure WebSites for background processing and batch jobs? I did, but have now been reformed. Feel like Worker Roles are a gigantic pain? You're not wrong. Enter Azure …

Doing unholy things in your Azure WebSites for background processing and batch jobs? I did, but have now been reformed. Feel like Worker Roles are a gigantic pain? You're not wrong. Enter Azure WebJobs. We will start with some boxes and lines explaining how WebJobs work, and where they fit in, and almost as importantly where they don't. Then we will go to some demos of how to write them, and the simple way of deploying. We will work with the different scheduling types : continuously running, triggered, and scheduled. Then we will talk about health and debugging, for each of these. Then we will work with how to get them to fit into your development workflow. I will even show you how to get your WebJobs to push updates through signalR. You will walk away with ways that WebJobs can help you be more productive and more decoupled in your code. Stop using hacks in websites to run batch jobs. Stop using Worker Roles to kill mosquitoes. Start using Azure WebJobs.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
171
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Next year’s date.
  • Next year’s date.
  • Transcript

    • 1. CUTYOUR HAIR AND GET AN AZUREWEBJOB! Mark Greenway @MarkKGreenway Who | What | When | Where | Why | How | OMG WHY?!
    • 2. THANKS SPONSORS! Who | What | When | Where | Why | How | OMG WHY?!
    • 3. Who the #$@& is this guy?? WHO | What | When | Where | Why | How | OMG WHY?!
    • 4. What is an AzureWebJob? Who| WHAT | When | Where | Why | How | OMG WHY?! Location Name Azure PaaS WebJob Azure PaaS (old) Worker Role Heroku Worker App Harbor Worker Unithttps://flic.kr/p/5uJsLG
    • 5. What is an AzureWebJob? Who| WHAT | When | Where | Why | How | OMG WHY?! Options Powershell .BAT (Batch file) Node.JS Python .exe .NET Application https://flic.kr/p/a2qceu
    • 6. What is an AzureWebJob? Who| WHAT | When | Where | Why | How | OMG WHY?! Can’t do Run Servers Invoke Server Applications https://flic.kr/p/a2qceu
    • 7. When Does an Azure WebJob Run? Who| What | WHEN | Where | Why | How | OMG WHY?! 1. Triggered 2. Continuous © 2013 Tim Buss
    • 8. When Does an Azure WebJob Run? Who| What | WHEN | Where | Why | How | OMG WHY?! 1. Triggered © 2013 Tim Buss • Scheduled • Manual
    • 9. When Does an Azure WebJob Run? Who| What | WHEN | Where | Why | How | OMG WHY?! 2. Continuous © 2013 Tim Buss • Runs AllTheTime (withAlways On) • .NETTriggers Run (with SDK)
    • 10. Where Does an Azure WebJob Run? Who| What | When | WHERE | Why | How | OMG WHY?! 1. With An AzureWebsite (W/AWS) https://flic.kr/p/7fXoky • Logically bound to a particular site • Deployment options • Separate Manual Deployment • CLI • Web Interface • Continuous Deployment with site • 1 …n
    • 11. Where Does an Azure WebJob Run? 2. With Only Other AzureWebJobs https://flic.kr/p/ajkTkm • Not Logically bound to a particular site • Deployment options • Separate Manual Deployment • CLI • Web Interface • Independent git etc deployments. • 1 …n Who| What | When | WHERE | Why | How | OMG WHY?!
    • 12. Who| What | When | Where | WHY | How | OMG WHY?! Why Use AWebJob: • Process Log Files • Process Orders • Migrate Deleted Items to Long term storage • Compress Uploaded Images • Add Watermarks to Images • Run Nightly Tasks • Import on premise data to azure • Manage Videos for Smooth Streaming • RSS Aggregation • Migrating Log Files • Long Running Tasks • Complex Creation of User Records • Interaction with slow 3rd party systems • Convert JSON to XML • Email users • Decoupling • Scalability • OCR • Billing
    • 13. How to Manually UploadAWebJob : 1. Put files into a folder 2. Zip all the files in the folder 3. Go toWeb or CLI Who| What | When | Where | Why | HOW | OMG WHY?!
    • 14. How to “PiggyBack” Upload AWebJob : 1. Put files into a folder 2. Copy that folder to App_Data/jobs/[continuous,triggered]/ 3. Deploy As Usual Who| What | When | Where | Why | HOW | OMG WHY?!
    • 15. How to Continuously UploadAWebJob : Who| What | When | Where | Why | HOW | OMG WHY?! 1. Create Project in Same Solution 2. Modify Build to copy that folder to App_Data/jobs/[continuous,triggered]/ 3. Deploy As Usual
    • 16. How to Continuously UploadAWebJob : 1. Create Project in Same Solution 2. Modify Build to copy that folder to App_Data/jobs/[continuous,triggered]/ 3. Deploy As Usual *Heavily Photoshopped for Clarity Who| What | When | Where | Why | HOW | OMG WHY?!
    • 17. How to create a .NETWebJob Who| What | When | Where | Why | HOW | OMG WHY?! 1. File -> New -> Console Application 2. Add NuGet Packages for extra tooling
    • 18. How to create a .NET WebJob Who| What | When | Where | Why | HOW | OMG WHY?! static void Main() { var host = new JobHost(); host.RunAndBlock(); } public static void AzureQueue([QueueTrigger("myqueue")] string userJson) {} public static void AzureQueueObject([QueueTrigger("myqueue")] Person person) {} public static void SbQueue([ServiceBusTrigger("sbqueue")] string person) {} public static void SbQueueObject([ServiceBusTrigger("sbobjectqueue")] Person person) {} public static void Resize( [BlobTrigger(@"images-input/{name}")] WebImage input, [Blob(@"images-output/{name}")] out WebImage output) {}
    • 19. How to TEST a .NETWebJob Who| What | When | Where | Why | HOW | OMG WHY?! //IN WEBJOB CLASS public static Person LastPerson { get; set; } public static void SbQueueObject([ServiceBusTrigger("sbobjectqueue")] Person person) { LastPerson = person; Console.WriteLine("Service Bus Object Queue : {0}", person); } //INTEST CLASS [Test] public void PersonSetsLastPerson() { var dawn = PersonCreator.CreatePerson("Dawn"); ImageProcessing.SbQueueObject(dawn); Assert.AreEqual(dawn,ImageProcessing.LastPerson); }
    • 20. How to Debug a .NET WebJob Who| What | When | Where | Why | HOW | OMG WHY?! https://cutyourhair.scm.azurewebsites.net/azurejobs/#/jobs
    • 21. 1.Use A Backplane 2.Post Directly to the Backplane How to Update SignalR from aWebJob Who| What | When | Where | Why | How | OMG WHY?!
    • 22. How to Update SignalR from aWebJob Who| What | When | Where | Why | How | OMG WHY?!
    • 23. How to Update SignalR from aWebJob Who| What | When | Where | Why | How | OMG WHY?!
    • 24. Who| What | When | Where | Why | How | OMG WHY?! https://twitter.com/rustd Pranav Rastogi Program Manager, Azure WebJobs, ASP.NET http://blog.amitapple.com/ Amit Apple Senior Software Developer, Azure Web Sites WhoTo Follow: http://twitter.com/shanselman Scott Hanselman Microsoft http://Friday.Azure.com Learn More:
    • 25. Who| What | When | Where | Why | How | OMG WHY?! Mark Greenway @MarkKGreenway

    ×