Microsoft Build 2016 in a Nutshell

Two weeks ago, I had an amazing opportunity to be at Microsoft Build Conference in San Francisco and I would like to share my experience about the conference with you in this post by highlighting what has happened and giving you my personal takeaways.
2016-04-09 18:59
Tugberk Ugurlu


Two weeks ago, I had an amazing opportunity to be at Microsoft Build Conference in San Francisco as an attendee thanks to my amazing company Redgate. The experience was truly unique and amount of people I have met there was huge. A bit late but I would like to share my experience about the conference with you in this post by highlighting what has happened and giving you my personal takeaways. You can also check out my tweets for the Build conference.

CeznGcRWAAE_QMw

Announcements

There were bunch of big and small announcements throughout the conference from Microsoft. Some of these were highlighted during two keynotes and some other announcements were spread to three days. I tried to capture all of them here but it's very likely I missed some of them (mostly the small ones):

Ce46IwXUsAA0Wil

Sessions

2016-03-31 15.28.14

Here is the list of sessions I have attended:

As much as I wanted to attend some other sessions, I missed some of them mostly due to clashes with other sessions. Luckily recordings for all Build 2016 sessions are available up on Channel 9. Here is my list of sessions to catch up:

There were also many good Channel 9 Live interviews. You can find them here. Here is a personal list of a few which are worth listening to:

IMG_1870

Personal Takeaways

All in all it has been a great conference and as stated, I am still catching up on the stuff that I have missed. Throughout the conference, I have picked up a few key points and I want to end the post with those:

  • I have seen more from Microsoft to make developers lives easier and more productive by enabling new tools (Bash on Ubuntu on Windows), supporting multiple platforms (Service Fabric to run on every environment including AWS, on-premises, Azure Stack and preview of Service Fabric on Linux), open sourcing more (some parts of Xamarin have gone open source) and making existing paid tools available for free (Xamarin is now free).
  • Microsoft is more focused on getting their existing services together and trying to give a cohesive ecosystem for developers. Service Fabric, Cognitive Services, Data Lake is a few examples of this.
  • .NET Core and CoreCLR is approaching to finalization for v1. After RC2, I don't suppose there will be much more features added or concepts changing.
  • I think this is the first time I have seen stabilization on client Apps story for Microsoft. Universal Windows Platform (UWP) was the focus on this area this year and it was the same on previous year.
  • I am absolutely happy to see Microsoft abandoning Windows Phone day by day. There was no direct sessions on it during the conference.
  • There were more steps towards making software to manage people's lives in a better way. Skype Bot Framework was one of these steps.
  • Microsoft (mostly Azure group) invests on IoT solutions heavily. Azure Functions and new updates on Azure IoT Suite are just a few signs of this.
  • Azure Resource Manager (ARM) and ARM templates are getting a lot of love from Microsoft and it's the way they push forward. They even build new services on Azure on top of this.

My Summary of DevConf 2016

I had an amazing time in Johannesburg this week and had the privilege to attend DevConf 2016 as a speaker. I gave a talk on architecting polyglot-persistent solutions and you can find the slides and resource in this post.
2016-03-10 16:23
Tugberk Ugurlu


I had an amazing time in Johannesburg this week and had the privilege to attend DevConf 2016 as a speaker. I got to travel to South Africa for the first time and I really liked the country, especially the food :) Also, I tried to be a social developer and had a chance to meet with a few new amazing folks like Colin Dembovsky, Lisa Basel, Chris Tite, Mark Pearl and many others that I cannot remember right now after a few beers at Dubai airport while writing this blog post :)

During the conference, I attended a few other talks apart from giving one. Here are all of them:

  • A year of dealing with RabbitMQ
  • Lap around Azure Machine Learning
  • Getting Started with Analytics (GTM and GA)
  • Brownfield TDD: How to eat an elephant?
  • Adjust your behaviour and be surprised how much you can influence your team
  • Building real world microservices using Node.js

I generally like to summarize my impressions I gained throughout the conference (e.g. Codemash 2016, NDC Oslo 2014). Here are those from DevConf:

  • People are pulling away from so-called Microsoft stack as much as it makes sense, especially on the data storage part. This is a good thing for everyone, even for Microsoft. Microsoft being more open has the biggest effect on this.
  • People who experienced relational database architecture where the business logic sits inside the database seems to have learnt the lessons very well.
  • Microservices had its appearance throughout the conference again :)
  • Polyglot persistence seems to be what most of the people are applying today without knowing the term that much :) Not knowing the term is no problem at all. Remember: this type of terms (e.g. Microservices) help communicate during planning processes and discussions easier.
  • Application and Database Lifecycle management is more about the culture and less about the tools. People who want to adopt this culture seek advice from consulting companies, they need tools just to get the job done.
  • Infrastructure as code is grabbing more and more attention.

My Talk: Architecting Polyglot-persistent Solutions

Apart from a few logistical problems during my talk (like electricity going out completely!), it was really good overall. This was very first time I have given this talk and it was based on the experience I had over a few years on Zleek.

2016-03-08 10.29.04

You can find the slides under my Speakerdeck account here.

Here are also a few more links that you may find useful on this topic:

Special Thanks

I would like to thank all the DevConf team who made this conference happen and all the audience for their amazing attention for the conference. I am especially impressed with the attention to the detail that the DevConf team has shown.

Upcoming Conferences and Talks

I am going to be at a few conferences in upcoming weeks and I would like to share them here with you. If you are going to be around for any of the below events, let's meet and say hi to each other :)
2016-02-27 16:45
Tugberk Ugurlu


I am going to be at a few conferences in upcoming weeks and I would like to share them here with you. Main objective here is to tell you about where I am going to be and this should help meeting new people and learning about different experiences. Jeremy Clark, a friend I met at Codemash 2016, has an amazing blog post on becoming a social developer. I encourage you to check that out to see why and how.

DevConf, Johannesburg (8th of March)

devconf

I am very, very excited about DevConf. Source of this excitement is the talk I will deliver there and the content of the conference. I will be presenting on architecting polyglot-persistent solutions as part of the Persistence and Data track. This is a topic which is very close to my heart as I had the first hand experience while working on Zleek on what a big difference this type of architecture can make on your software product. It will also be the first time I will deliver this talk.

Rest of the agenda also looks pretty impressive. So, I am sure this will be well worth the long trip to South Africa :)

Microsoft Build 2016, San Francisco (30th of March - 1st of April)

image

At the end of March, I will also be in San Francisco to attend Microsoft Build conference. This is also very exciting for several reasons. Obvious one is that there will be a lot of existing and soon-to-be friends there from the community and this is a very developer centric conference in view of Microsoft products. Also, I don't get to attend conferences that often as an attendee. I am sure I will feel the comfort of gliding through the session rooms and not trying to prepare for a talk. If you add the fact that this is going to be my first trip to San Francisco, it will be a real fun :)

Last year, my wish for Build Conference announcements came true with Visual Studio Code and I am very much looking forward to this year's announcements, too.

I T.A.K.E. Unconference 2016, Bucharest (19th - 20th of May)

image

At I T.A.K.E. Unconference 2016, I will talk about two very interesting topics and I think both of them are very interesting considering the type of software solutions and the way we produce them nowadays.

I am very much looking forward both of them since it's going to be the first time that I present these sessions. It seems like it's still possible to register and you can also check the rest of the schedule out here.

If you are going to be around for any of the above events, let's meet and say hi to each other :)

Managing SQL Server Express LocalDB Instances Through SqlLocalDB.exe Utility Tool

I love the feeling when I discover a tiny, hidden tool and SqlLocalDB.exe, a management utility tool for Microsoft SQL Server LocalDB which allows you to manage the LocalDB instances on your machine, is one of them. Let me show you what it is.
2016-02-18 12:46
Tugberk Ugurlu


I love the feeling when I discover a tiny, hidden tool which I can put into my daily software toolbox. I started to sense this feeling more and more lately with some amazing command line tools and I want to write about those here (famous last words) like I did for http-server and WAStorageEmulator.exe a while back. Today, I want to start this by writing about SqlLocalDB.exe, a management utility tool for Microsoft SQL Server Express LocalDB which allows you to manage the LocalDB instances on your machine such as creating, starting and stopping them. This is really handy if you are after creating lightweight SQL Server instances for temporary processing like we do as part of some DLM Automation Suite PowerShell cmdlets (e.g. Invoke-DlmDatabaseSchemaValidation).

image

I am not entirely sure hot you would install this tool and I failed to find out exactly how. However, it seems like this comes with the LocalDB installation and you can acquire that through here (also check out Scott Hanselman's ironic "Download SQL Server Express" blog post).

This may depend on the version you installed but I can locate the SqlLocalDB.exe under "C:\Program Files\Microsoft SQL Server\120\Tools\Binn" on my machine and after that, it's just executing the commands. For example, I can execute the info command to see the LocalDB instances I have in my machine:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe info

MSSQLLocalDB
RedGateTemp

I can also list which versions of LocalDB I have installed on my machine:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe versions

Microsoft SQL Server 2014 (12.0.2000.8)

Let's create our own instance through the create command:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe create tugberk

LocalDB instance "tugberk" created with version 12.0.2000.8.

You can view the status of an instance through the info command by passing the instance name as an argument:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe info tugberk

Name:               tugberk
Version:            12.0.2000.8
Shared name:
Owner:              TUGBERKPC\Tugberk
Auto-create:        No
State:              Stopped
Last start time:    2/18/2016 12:06:00 PM
Instance pipe name:

Let's start the instance through the start command:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe start tugberk

LocalDB instance "tugberk" started.

We can see that it has started:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe info tugberk

Name:               tugberk
Version:            12.0.2000.8
Shared name:
Owner:              TUGBERKPC\Tugberk
Auto-create:        No
State:              Running
Last start time:    2/18/2016 12:09:28 PM
Instance pipe name: np:\\.\pipe\LOCALDB#7F6D2993\tsql\query

Great, now I can connect to this instance using the provided magical, special instance pipe name:

image

Or, LocalDB server name by prefixing the instance name with "(localdb)\":

image

If you dig a little deeper, you will see that an instance of "sqlservr.exe" has been started for your LocalDB instance:

image

You can also see that all LocalDB data is stored under "%LOCALAPPDATA%\Microsoft\Microsoft SQL Server Local DB\Instances".

From there, you can treat this instance as a usual SQL Server instance and perform whatever operation you want to perform on it. Be aware that LocalDB has the same limitations as SQL Server Express.

image

Finally, you can stop the instance through the stop command:

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB.exe stop tugberk

LocalDB instance "tugberk" stopped.

Further Information

NGINX Reverse Proxy and Load Balancing for ASP.NET 5 Applications with Docker Compose

In this post, I want to show you how it would look like to expose ASP.NET 5 through NGINX, provide a simple load balancing mechanism running locally and orchestrate this through Docker Compose.
2016-01-17 14:39
Tugberk Ugurlu


We have a lot of hosting options with ASP.NET 5 under different operating systems and under different web servers like IIS. Filip W has a great blog post on Running ASP.NET 5 website under IIS. Here, I want to show you how it would look like to expose ASP.NET 5 through NGINX, provide a simple load balancing mechanism running locally and orchestrate this through Docker Compose.

It is not like we didn't have these options before in .NET web development world. To give you an example, you can perfectly run an ASP.NET Web API application under mono and expose it to outside world behind NGINX. However, ASP.NET 5 makes these options really straight forward to adopt.

The end result we will achieve here will have the below look and you can see the sample I have put together for this here:

arch-diagram

ASP.NET 5 Application on RC1

For this sample, I have a very simple APS.NET 5 application which gives you an hello message and lists the environment variables available under the machine. The project structure looks like this:

tugberk@ubuntu:~/apps/aspnet-5-samples/nginx-lb-sample$ tree
.
├── docker-compose.yml
├── docker-nginx.dockerfile
├── docker-webapp.dockerfile
├── global.json
├── nginx.conf
├── NuGet.Config
├── README.md
└── WebApp
    ├── hosting.json
    ├── project.json
    └── Startup.cs

I am not going to put the application code here but you can find the entire code here. However, there is one important thing that I want to mention which is the server URL you will expose ASP.NET 5 application through Kestrel. To make Docker happy, we need to expose the application through "0.0.0.0" rather than localhost or 127.0.0.1. Mark Rendle has a great resource on this explaining why and I have the following hosting.json file which also covers this issue:

{
    "server": "Microsoft.AspNet.Server.Kestrel",
    "server.urls": "http://0.0.0.0:5090"
}

Running ASP.NET 5 Application under Docker

The next step is to run the ASP.NET 5 application under Docker. With the ASP.NET Docker image on Docker Hub, this is insanely simple. Again, Mark Rendle has three amazing posts on ASP.NET 5, Docker and Linux combination as Part 1, Part 2 and Part 3. I strongly encourage you to check them out. For my sample here, I have the below Dockerfile (reference to the file):

FROM microsoft/aspnet:1.0.0-rc1-update1

COPY ./WebApp/project.json /app/WebApp/
COPY ./NuGet.Config /app/
COPY ./global.json /app/
WORKDIR /app/WebApp
RUN ["dnu", "restore"]
ADD ./WebApp /app/WebApp/

EXPOSE 5090
ENTRYPOINT ["dnx", "run"]

That's all I need to be able to run my ASP.NET 5 application under Docker. What I can do now is to build the Docker image and run it:

docker build -f docker-webapp.dockerfile -t hellowebapp .
docker run -d -p 5090:5090 hellowebapp

The container now running in a detached mode and you should be able to hit the HTTP endpoint from your host:

image

From there, you do whatever you want to the container. Rebuild it, stop it, remove it, so and so forth.

NGINX and Docker Compose

Last pieces of the puzzle here are NGINX and Docker Compose. For those of who don't know what NGINX is: NGINX is a free, open-source, high-performance HTTP server and reverse proxy. Under production, you really don't want to expose Kestrel to outside world directly. Instead, you should put Kestrel behind a mature web server like NGINX, IIS or Apache Web Server.

There are two great videos you can watch on Kestrel and Linux hosting which gives you the reasons why you should put Kestrel behind a web server. I strongly encourage you to check them out before putting your application on production in Linux.

Docker Compose, on the other hand, is a completely different type of tool. It is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file (which is a YAML file) to configure your application’s services. This is a perfect fit for what we want to achieve here since we will have at least three containers running:

  • ASP.NET 5 application 1 Container: An instance of the ASP.NET 5 application
  • ASP.NET 5 application 2 Container: Another instance of the ASP.NET 5 application
  • NGINX Container: An NGINX process which will proxy the requests to ASP.NET 5 applications.

Let's start with configuring NGINX first and make it possible to run under Docker. This is going to very easy as NGINX also has an image up on Docker Hub. We will use this image and tell NGINX to read our config file which looks like this:

worker_processes 4;

events { worker_connections 1024; }

http {
    upstream web-app {
        server webapp1:5090;
        server webapp2:5090;
    }

    server {
      listen 80;

      location / {
        proxy_pass http://web-app;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
      }
    }
}

This configuration file has some generic stuff in it but the most importantly, it has our load balancing and reverse proxy configuration. This configuration tells NGINX to accept requests on port 80 and proxy those requests to webapp1:5090 and webapp2:5090. Check out the NGINX reverse proxy guide and load balancing guide for more information about how you can customize the way you are doing the proxying and load balancing but the above configuration is enough for this sample.

There is also an important part in this NGINX configuration to make Kestrel happy. Kestrel has an annoying bug in RC1 which has been already fixed for RC2. To work around the issue, you need to set "Connection: keep-alive" header which is what we are doing with "proxy_set_header Connection keep-alive;" declaration in our NGINX configuration.

Here is what NGINX Dockerfile looks like (reference to the file):

FROM nginx
COPY ./nginx.conf /etc/nginx/nginx.conf

You might wonder at this point about what webapp1 and webapp2 (which we have indicated inside the NGINX configuration file) map to. These are the DNS references for the containers which will run our ASP.NET 5 applications and when we link them in our Docker Compose file, the DNS mapping will happen automatically for container names. Finally, here is what out composition looks like inside the Docker Compose file (reference to the file):

webapp1:
  build: .
  dockerfile: docker-webapp.dockerfile
  container_name: hasample_webapp1
  ports:
    - "5091:5090"
    
webapp2:
  build: .
  dockerfile: docker-webapp.dockerfile
  container_name: hasample_webapp2
  ports:
    - "5092:5090"

nginx:
  build: .
  dockerfile: docker-nginx.dockerfile
  container_name: hasample_nginx
  ports:
    - "5000:80"
  links:
    - webapp1
    - webapp2

You can see under the third container definition, we linked previously defined two containers to NGINX container. Alternatively, you may want to look at Service Discovery in context of Docker instead of linking.

Now we have everything in place and all we need to do is to run two docker-compose commands (under the directory where we have Docker Compose file) to get the application up and running:

docker-compose build
docker-compose up

After these, we should see three containers running. We should also be able to hit localhost:5000 from the host machine and see that the load is being distributed to both ASP.NET 5 application containers:

compose2

Pretty great! However, this is just sample for demo purposes to show how simple it is to have an environment like this up an running locally. This probably provides no performance gains when you run all containers in one box. My next step is going to be to get HAProxy in this mix and let it do the load balancing instead.

Tags