I am at the Azure Firestarter event in Redmond today and just heard Steve Marx give a lap around the platform.  Here are my notes; slides and sample code are to be posted later and I will update the post with them when they are.

Idea behind Azure platform - we no longer think about transistors and what gates do I use to thinking about chips - how do I write machine code - then assembly and high-level languages. How do I connect to these different devices? Adding OS to abstract the basic needs of memory management, chips, devices, etc. We don't program to the machine layer, we program to the OS layer. But now building apps that run on many different machines - with minimal support from the OS. You have to think about too much low-level stuff - what load-balancer to get, whether the router is configured correctly, what version of the OS is on each of the servers, etc.

Azure is to provide an abstraction that lets you think about data centers rather than those low-level details.

.NET, PHP, Ruby, Java, … whatever

  • Windows Azure is not an operating system. The OS is Windows. There is a layer on top of Windows that provides a platform.
  • Anything that can be copy deployed to a Windows Server 2008 machine is probably going to be fine porting to Azure. Anything that requires more than a copy deployment might need more work.
  • Can do create new .ASP net project and add to solution - and it will work.
  • Csrun /devfabric:shutdown - F5 in VS just calls out to the command line tools to execute the dev fabric
  • Upload starts a worker role instance to transfer the file into a blob, then generate a thumbnail.
  • How it works…
    • Two roles
      • AnnoySmarxWeb is the ASP.Net MVC app to show the UI
      • Thumbnail Generator generates the thumbnail.
      • Upload code
        • Upload the file Request.Files[0] is the file uploaded
        • Uploadfromstream on the blob to get it.
        • The creates a cloudqueue and adds a message with the GUID name of the blob that was uploaded.
        • Worker role just finds the full-size blob in storage and generates thumbnail.
      • Thumbnail generator
        • Reliable queues don't automatically dequeue the message - so that if you die while processing it, it will stay on the queue. It's just "invisible" while you're processing it. Then when you finish, you dequeue it using DeleteMessage.
          • Need to design for multiple workers dequeuing the same message and doing the work on it. Reason is that the message will reappear on the queue if you don't dequeue it, and another worker could then get it even though one worker has done most or all of the work on it. Two scenarios:
            • One worker dequeues, does all the work and then keels over dead before being able to delete it from the queue
            • One worker dequeues it, does all the work and then before he gets to delete it, the wait time expires and so it becomes visible again on the queue. This could happen due to unusual network conditions. So think about the invisible time to be long enough to make this very unusual.
            • Won't typically happen -so OK if your performance is bad if it happens, but you have to be able to handle it.
            • Messages will be deleted from the queue if not dequeued after 7 days.
        • Setting the cachecontrol allows the CDN in 18 different countries to cache it.
        • Messages are limited to 8KB.
          • For more data, create a blob and reference the blob in the message.
  • Q: Is Azure PCI compliant?
    • It is possible to build PCI-compliant systems using Windows Azure, but Azure is not itself PCI compliant.
  • Q: What is the limit on Azure scale-out?
    • Compute - Need a credit check to go beyond 20 instances.
    • Storage - Scale up 1 GB, 10 GB and 50 GB database options. Then have as many databases as you want.
      • 10 GB database costs about $100/month.
      • So for massive scale, want to probably use another option.
        • 15 cents per Gigabyte per month for Windows Azure storage - so 10 GB would cost $1.50 per month.
        • Only one index = the key.
        • No join, no group by, no sort
        • Automatically partition, replication (3x), strong write consistency, optimistic concurrency.
      • For SQL, go to the Azure portal, ask for a new database, specify the size and get a connection string you use in your code.
  • ADO.NET Data Services == Astoria == Odata == WCF Data Services == REST API to data
  • Q: Does blob store expose WebDAV? A: No but you could write your own. Blob store exposes REST API.
  • Connectivity
    • How did the wallpaper change on Smarx's desktop when the blob was uploaded to the cloud?
    • Service Bus and Access Control a/k/a Windows Azure Platform AppFabric
      • Service Bus solves the problem of having two apps behind firewalls but want to talk to each other.
        • Manages the relay
        • Each makes outbound connections to the service bus in the cloud and the service bus manages the connection and if possible negotiates a P2P connection.
      • Common patterns
        • Eventing
          • One-way communication
          • Unicast or multicast
          • Immediate or buffered
        • Remoting
          • RCP, request/response, or duplex
      • There is a sample with the app fabric SDK that shows how to send trace events.
    • Programming model for Service Bus is basically WCF but you switch a couple of bindings.
    • There is a "hello world" kind of training in the SDK
    • For the AnnoySmarx demo
      • The URL for the thumbnails in the display points to the service bus endpoint for set wallpaper. It's not that the Windows Azure service displaying the thumbnails is doing the change - you are in the browser by invoking the URL to change it.
      • There is an interface that sets the wallpaper - called from browser
      • Use ServiceBus.CreateServiceURI to figure out where to listen
    • ClemonsV has a good blog on using Service Bus
    • Q: From the client perspective, is it push or pull?
      • It's a bit of both. Both sides establish a connection with the service bus.
      • From the programming model, it looks like push. But then eventually something gets sent down through the connection because something happened on the other end.
      • Client code just sits there and listens.
    • Pricing model is per connection.
    • Access Control
      • About claims-based authentication on top of REST APIs.
      • It does Active Directory federation.
      • Uses OAuth WRAP and simple web tokens.
      • Core scenario
        • I have a REST API and I want to give people access using claims-based authentication but I don't want to write all the goo to do that.
        • Client that wants access to the service talks to the Access Control service to request an access token for the service.
        • Access Control returns a simple web token.
        • When client invokes the REST Service, it passes the access token.
        • The REST service needs some code
          • The service maintains a periodic connection to the Access Control service to keep a trust relationship between them.
          • The service has to accept the access token on a request
        • If you've used OpenID, it's a similar idea.