Jason Haley

Ramblings from an Independent Consultant

DevBoston–WebJobs In Depth

The powerpoint presentation for Thursday night’s presentation can be found here: DevBoston-AzureWebJobs.pptx

Here is the Producer-Consumer demo code.  I’m still surprised that it takes so little code to do this:

using Microsoft.Azure.WebJobs;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProducerConsumer
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = new JobHostConfiguration();

            config.UseDevelopmentSettings();
            config.UseTimers();

            var host = new JobHost(config);
            host.RunAndBlock();
        }
    }

    public static class Functions
    {
        public static int counter = 0;

	// Create a new message on the "orders" queue every 10 seconds
        public static void Producer(
            [TimerTrigger("00:00:10", RunOnStartup=true)] TimerInfo timer,
            [Queue("orders")] out string messageCount,
            TextWriter log)
        {
            messageCount = "message" + counter++;

            log.WriteLine("messsage: " + messageCount);
        }

	// Watch the "orders" queue for messages, and when one is found save it to blob storage
        public static void Consumer(
            [QueueTrigger("orders")] string message,
            [Blob("orders/order.txt")] out string order,
            TextWriter log)
        {
            order = message;

            log.WriteLine("Received " + message);
        }
    }
}

Boston Code Camp 25 Notes and Resources

Yesterday I gave two presentations at Boston Code Camp 25, here are some notes and resources from my talks.

6+ Years After Going Independent (https://www.bostoncodecamp.com/CC25/Sessions/Details/16336)

This is always a fun talk for me to give – and a real easy one to prepare for.  Yesterday’s audience was the biggest I’ve had so far at a code camp for this talk.  

Here’s the 10 points I covered in the talk:

  1. First a word about FTE vs. being Independent
  2. Know how much you need to make a month to pay your bills
  3. Have 3 – 6 months living expenses in savings always
  4. Setup a business entity LLC, S-Corp or C-Corp
    1. ~$500 a year for LLC in MA
  5. Get a commercial bank account for the business
    1. Checking
    2. Credit Card
    3. Always use business account for business purposes
    4. Stay Organized (Quicken or Quickbooks)
  6. Get an accountant
  7. Get a lawyer
    1. Contract
    2. NDA
  8. Build a brand
  9. Consultant vs. Contractor
  10. Finding work
    1. Build your expertise
    2. Network
    3. Repeat

The power point can be found here: GoingIndependent6.pptx

WebJobs in Depth (https://www.bostoncodecamp.com/CC25/Sessions/Details/16335)

This presentation was much better than trying to split an hour on both Web Sites and Web Jobs.  However I did not get a chance to practice the whole talk a couple of times like I really wanted to.

I did get to present at least 4 ways of deploying web jobs and got to show simple demos of triggers from both the Web Jobs SDK and the Web Jobs SDK Extensions.

This Thursday I’ll be able to extend this talk more for DevBoston (http://www.meetup.com/DevBoston/events/229688772/)

The power point can be found here: AzureWebJobs.pptx