Category Archives: Azure

Winnipeg Azure Bootcamp 2017

The Global Azure Bootcamp 2017 hosted by the Winnipeg .Net User Group was a success. There was a good number of people in attendance for the event. The presentations were excellent which made it difficult to choose some standout topics. In saying that, here are a few items that I brought back from the event to dig in deeper.

Azure Functions with F#

The ability to create Azure functions which run F# has to be the big takeaway for me. An Azure function is Microsoft’s vision of a serverless architecture. The idea is we don’t need to worry about scaling web applications as that is handled automatically by Azure. Azure functions run based on a script file we code. F# has a very good story for prototyping using the REPL and F# script files (fsx). See what I’m thinking? This is a great opportunity to go from prototype to testing in the cloud with possibly little friction.

Let’s give it a quick go.

Open up your Azure portal and add a new “Function App”. Enter in the required details, App name, Subscription, Resource Group, … etc. Once everything is created you can click on your new function. Click the plus sign to the right of “Functions”, then scroll down and click “Custom function”. You can filter the “Language” to F# using the drop down. Select HttpTrigger-FSharp as the template for our function. Name your function and click create.

The new function comes with some template code in the online editor. We can replace the default code in the file “Run.fsx” with:

#r "System.Net.Http"

open System.Net
open System.Net.Http

let Run(req: HttpRequestMessage, log: TraceWriter) =
    req.CreateResponse(HttpStatusCode.OK, "F# and Azure Functions FTW!")

Click the “Save” and “Run” button and we should see our message in the result pane in the bottom right.

Azure functions and F# are going to be an unstoppable combination.

Docker Everywhere

We saw a great demo on the ability to upload and create docker containers in Azure. The presenter, Alexander Trauzzi, created a TypeScript application with Geotagging and deployed it in a docker image. He then loaded the same docker image to multiple Azure data centers around the world. After a bit of answering questions, the map of the world started to display little Azure clouds. It was very cool.

Alex setup a guide you can follow if you want to try the demo yourself.
https://github.com/atrauzzi/azure-bootcamp-2017/blob/master/guide_local.md

Testing in Production

Testing in production allows you to have multiple deployment slots for an Azure website and set differing amounts of traffic to each. There is no misconception with the name of this feature. You are literally testing in production, however this is more of a controlled production test.

In order to try this out, create your App Service in a standard or premium plan.

Here are some rough steps to get setup:

  1. In the Deployment group of your app service, click on Deployment Slots.
  2. Click on Add Slot to create a new deployment slot.
  3. In the Development Tools group, click on Testing in production.

You should now be able to click the drop down which says Choose deployment slot, and change the traffic percentage we want to route to that deployment.

This gives us a way to control the amount of testing traffic to the new version of our site. Once we are satisfied of the new site’s stability, we can use switch the sites using the Swap button from the app’s Overview.

Summary

My big three takeaways from Global Azure Bootcamp 2017 was F# with Azure Functions, deploying and running our Docker images in Azure, and testing in production.