All posts by Maria Ines Parnisari

//BUILD 2017: Day 1 Recap

If you’ve been watching Microsoft’s live stream for //Build 2017 that is taking place at Seattle, WA, you know that it is impossible to make a recap of all the news of Day 1 without leaving out a few things. If you haven’t been watching, well, you missed a lot! But don’t panic, while we’re here we wanted to share the latest and most important announcements.

New: Azure mobile app for iOS and Android

Microsoft announced an app that will allow us to manage our Azure account: check statuses and metrics and launching and stopping resources. You can go ahead and download it right now!

New: Azure Cloud Shell integrated into Azure Portal

There’s now (in Preview) a command line integrated into the Azure Portal. This allows you to manage your resources in a programmatic way (websites, virtual machines…). Note that in order to be able to persist your files across sessions, you need to create a storage account and file share. Also, support for PowerShell will be coming soon. Read more about the Shell here.

cloud shell

New: Visual Studio Snapshot Debugger

You don’t have to leave your IDE to find out what’s crashing your production app. Azure can now collect snapshots and you can launch them in Visual Studio 2017 Enterprise. These snapshots show you the state of the variables at the moment the error occurred. Read more about this Preview feature here and download the extension here.

Snapshot Debugger

New: Visual Studio for Mac

One of the biggest announcements made today is not even for Microsoft’s main platform. We were all very excited when cross-platform Visual Studio Code was launched, but now the Visual Studio we all know is available as a native app for MacOS, and you can develop Windows, Mac and mobile applications through Xamarin. Download it here.

Visual Studio for Mac

Updated data support in Azure: MySQL, PostgreSQL and NoSQL

Until now, Microsoft only offered SQL Azure databases for the relational database developers. Today it was announced that support for MySQL and PostgreSQL servers will be added too. Microsoft also announced support for Azure Cosmos DB – a globally distributed, multi-model database which supports key-value, document and graph data types.

Updated Visual Studio 2017

Visual Studio has seen many interesting updates in the last couple of weeks, and today we got to learn about some more. Docker is now fully integrated with Visual Studio, and cross-container debugging is supported.

Cross-container debugging in VS

Visual Studio 2017 Version 15.3 Launched

VS 2017 15.3

This Preview version of Visual Studio can be installed in parallel to Visual Studio 2017 and it includes many useful features:

  • Added support for Azure Functions (Microsoft’s serverless experience), enabling developers build and debug functions. Download the Tools here and see the full release notes here.

Azure Functions

  • Automatic file detection: when you drop a file into a folder, Visual Studio will automatically detect it and include it in the project.

Automatic File Detection

  • Live unit testing support for .NET Core projects: run your tests as you code.

Live Unit Testing

  • Enhanced debugging experience; for example, by showing which variable is null on exceptions.Null Var Unknown? Not anymore!

Azure IoT Edge & Azure Stack

With IoT Edge you can run all sorts of services in devices like the Raspberry Pi, including Azure Functions, Machine Learning and the IoT Hub, even when their connection to the Internet is limited and enabling real-time analytics. Along these lines, Azure Stack, an on-premises version of Azure, was announced.

Azure Stack

Updated Cognitive Services with Custom Cognitive Services

Microsoft wants to push the boundaries on what be done with AI. It already offers a very large set of APIs to perform complex processing tasks like speech recognition, image analysis and language understanding, and it announced today a new set of services that will allow developers to build their own custom models and train them.

Cognitive Services

There’s obviously a lot more to come on Day 2, but we didn’t want to end this post without giving a special mention unrelated to the previous updates: Emma’s Project, a piece of wearable technology made to improve the handwriting ability of people with Parkinson’s disease.

Parkinson's Gadget

Getting ready for the “Programming in HTML5 with JavaScript and CSS3” Microsoft Exam

Knowing HTML, CSS and JavaScript is essential to any web developer, and the Microsoft Exam 70-480 “Programming in HTML5 with JavaScript and CSS3” allows you to become certified in those technologies. Although in my opinion the exam is not a reliable measure of how well you can program in those languages (this is a debatable topic, but I won’t talk about this here), in my case it provided the motivation I needed to study something I had been postponing.

I had some basic knowledge of HTML and CSS, but JavaScript was new to me. To get trained, I read back to back the Official Training guide (at an average of two chapters a day, I finished it in two weeks). I found it to be an excellent book; it provides both theoretical information as well as practice exercises and code samples; not to mention the quizzes at the end of each lesson to test your knowledge. It has a few disadvantages though: there are a few errors here and there, and it doesn’t cover 100% of the exam topics. Oh, and the black-and-white code snippets were a pain to read; I recommend buying the eBook format to copy and paste snippets in your favorite IDE to try them out (or use jsfiddle).

Anyway, I realized that the book didn’t cover everything on the exam after I compared the contents to the Skills tested in the exam. You need to dig deeper than the book, and of course the internet is an excellent source.

Here are a few topics I had to review before taking the exam:

  • CSS animations with the “transition” and “transform” properties. It’s not covered at all in the training guide, and for the exam you need to know for instance how to rotate an element counter-clockwise. Also, it’s not an exam topic but it’s worth knowing about the existance of keyframes, which allow you to specify intermediate steps for your animations (something you can’t do with transitions).
  • CSS exclusions, which basically only work in IE and it’s a way to specify how content flows around an element (like a “float”).
  • The JavaScript stuff, i.e. how the “this” keyword really works in the context of a script, a function, an object, and an event handler. (This is a big topic and can take some time to grasp if you are new to JavaScript – I recommend this article).
  • More JavaScript stuff: call() versus apply() functions to force a certain meaning to the “this” keyword, and the various ways of attaching event handlers to elements.
  • How to do layouts with columns, grids, and flexible boxes. Again, these aren’t covered in the book, and they’re quite large topics. Basically, the multi-column properties are just what they sound like; grids are like tables and they only work in Internet Explorer, and flexible boxes give a “container” element the ability to alter its child elements’ width and height to best fill the available space.
  • Know how to style text with underlines, sizes, shadows, etc. Also, know how to put shadows and curved borders around boxes with the box-shadow and border-radius CSS properties.
  • CSS positioning. For me it was one of the hardest concepts in the exam, and it is a key concept of CSS, so you’d better spend some time on it. Here’s my quick summary:
    • Static positioning tells the browser to put the element where it should go according to the HTML. With this scheme, setting the “top”, “left”, etc. values don’t make any sense.
    • Relative positioning takes the element, places it where it should go according to the HTML, and then moves it relative to this position.
    • Absolute positioning tells the browser to *remove* the element from the HTML flow and put it relative to the first non-static element. If all the parent elements are static, it will position it relative to the browser window.
    • Fixed positioning is like absolute positioning, but always in relation to the browser window.
  • How to make calls to web services using AJAX, in all four combinations: sync, async, with jQuery and without jQuery. Also, know how to be cross-browser compatible without jQuery (i.e. using ActiveX objects instead of XMLHttpRequest objects).
  • How to implement classes and inheritance in JavaScript. Coming from C#, this was a huge move for me and it was not intuitive at first. The fact that you define a class by wrapping it inside a function blew my mind 🙂
  • Web workers. Know how they work, i.e. it’s a script placed in a different file that executes in the background, and it doesn’t have access to the DOM, so you communicate with it through bidirectional messages. Also, know how to terminate them from the client and within the worker itself.
  • How to get the location of a user using the geolocation APIs, in the two flavors: one-time requests or continuous updates.
  • The RegEx object in JavaScript, and how to write patterns to test strings against them, so as to validate user input. Regexes are a big topic on itself so you should devote some time to it if you’re new to it.
  • Media queries, also not explained in the book.

And here are a few tips that got me through my learning:

  •  The first thing you should do before preparing for the exam is actually knowing what the exam is about and identify the areas you need to work on and which areas are new to you. For this, read the Skills section on the exam description.
  • When in doubt, ask StackOverflow. I found it especially useful to search for the differences between topics, e.g. the difference between “return true” and “return false” in event handlers, the different jQuery methods to set the content of an element (val(), text() and html()), the meaning of the “accept”, “dataType” and “contentType” parameters in AJAX…
  • Do the practice exercises of the book. They are not just “copy and paste” instructions; they actually tell you, for example, “implement a function that will take user input and perform this and that” and then show you the code to do it; you can code it yourself and then “peek” at the answer. Also, try to add your own functionality to the sites you create.
  • Have a look at caniuse.com to see what features and APIs are available in each browser.
  • To learn CSS: If you find a site you like or with an interesting layout, try copying it to see what you come up with.

Happy studying and good luck in the exam!

Introduction to Docker

Introduction to Docker

Docker, “Dockerize your app”, Docker container… These are all words that we’ve been hearing for while, but we never really got into trying to understand what it all meant… until now. So, the goal of this post is to share a brief introduction to the Docker platform, help clear up the confusion about what Docker tries to achieve, and hopefully make you want to try it out for yourself!

What is Docker and how is it different from a Virtual Machine?

The standard way of deploying an application (whether it is to test it or to run it in a Production environment) is to run it in a virtual machine. However, we all know what a pain this is. A virtual machine can take up to several minutes to boot up. There is no protection against crashes, and the performance is not that good.

Here’s where Docker comes into play. Docker is an open-source platform for developers and system administrators to develop, ship, and run applications.

Put simply, Docker enables you to deploy your application to a container. These containers are a bit like virtual machines, but less demanding over the host computer, and they are superfast to create. Unlike a virtual machine, where your application and the OS are tied together, a container splits these by making the OS a shared asset among containers. And, most importantly, containers are isolated. They may share the virtual machine with other containers, but they may never know about each other.

Virtual Machines vs. Docker Containers

Virtual Machines vs. Docker Containers

What are Docker’s characteristics?

The main characteristics of Docker are portability, agility and self-sufficiency:

  • Portability. One of Docker’s greatest benefits is that it enables cross-platform deployment. We can deploy Docker containers on Windows, Linux or Mac. Also, Docker is available on many cloud-platforms like Amazon EC2, Microsoft Azure, Google Cloud, etc.
  • Agility. As discussed earlier, containers are often compared to virtualization. While in a virtual machine you can find a full O.S. installed, containers use and share the O.S. and device drivers of the host. Therefore, containers are smaller than VMs, start up much faster, and have better performance.
  • Self-sufficiency. A Docker container has only the libraries, files and configurations needed to deploy specific functionalities. Docker handles the management of the container and its containing applications.

What are Docker’s components?

To understand Docker’s internals, you need to know about three components:

  • Docker images. They are the build component of Docker: they contain all the dependencies of your application.  You specify how to build an image using a file called Dockerfile, which is nothing more than a series of commands.
  • Docker containers. They are the run component of Docker, and they are basically an instance of an image. They hold everything that is needed for an application to run. Each container can be run, started, stopped, moved and deleted.
  • Docker registries. They are the distribution component of Docker. They are repositories that hold base images, and they can be public (Docker Hub) or private.

So let’s say you have your application and you want to deploy it to a Docker host. How can you do this? There are several ways, but this is the most common:

  1. Create a Dockerfile that specifies what your app needs to run (i.e., define an image).
  2. Connect to the Docker Host.
  3. Using the Dockerfile, create an image in the Host.
  4. Create a new container using this image.
  5. Start the container. Your app is now “Dockerized”!
  6. Optionally, you can take a snapshot of this container. This will create a new image which you can then push into a Registry for later use.
Docker Architecture

Docker Architecture

Interested? Read on!

Docker and Microsoft announce more innovation to cross platforms and win hearts

This blog post shows the improved cross-platform experience with Docker, Visual Studio Online and Microsoft Azure.

A few highlights of our own…

  • The cross-platform experience of Docker has been enhanced to allow the deployment of an app into a container hosted in Windows Server.
  • It will soon be possible to use Visual Studio Online to define a customizable continuous integration pipeline to build, unit test, and deploy multiple containers.
  • Integrations with the Azure Marketplace: it is possible to deploy a single or a multi-container application.

Run Azure CLI as a Docker Container: Avoid installation and setup

This blog post takes advantage of the new Docker image that includes the Azure Command Line Interface, which is supported on Linux, Mac and Windows.

A few highlights of our own…

  • The official microsoft/azure-cli Docker image allows us to rapidly move between different clients.
  • Using that base image we can create a custom image on top of it and save it for future use.

Getting started with Docker on your Raspberry Pi

Docker + IoT = Fun! This blog post shows how to download a Docker image containing a simple webserver into a Raspberry Pi, then launch a container within the device to run the webserver, and browse to that webserver in a workstation.

MVA: Exploring Microservices in Docker and Microsoft Azure

This training course provides an overview of how Lean Engineering, Continuous Delivery, the Cloud and Microservices architecture fit together.

Module 1: Cloud, Continuous Delivery and Microservices

Highlights:

  • Historical evolution of Software Architecture, introducing the microservices architecture.
  • Microservices characteristics, benefits and challenges.
  • How this new approach fits in small, distributed, decoupled agile teams.
  • Microservice is a unit of deployment and a unit of functionality. It can be stateless or stateful, but it is isolated and scaled independently of other microservices.

Module 2: Docker: Containers and Microservices

Explains the difference between Microservices (an architectural pattern) and Containers (a virtualization concept for which Docker is an implementation).

Highlights:

  • The distributed system history and how containers were inspired by the cargo industry.
  • Short demo using Azure Docker VM and a few commands.

Module 3: Microservices architecture for .NET

Some demos on discoverability and composition of microservices.

Highlights:

  • Usage of the –link parameter to allow inter-container communication with Docker

Module 4: Microservices and IoT

Dockercon 2015 Keynote videos

These videos show information about the company that built Docker, the problems that Docker solves, some experimental features, the intricacies behind the technology, etc.

Highlights:

  • Explains the different problems that Docker solves for developers (e.g. runtime, packaging and distribution, services composition, machine management and clustering).
  • The Docker experimental releases are introduced (https://docker.com/experimental). Additionally, some experimental features are presented (such as Docker network).
  • How to scale an application using Docker commands
  • runC: Docker OS Containers code

Docker Security

This video shows how Docker provides security.

A few highlights:

  • How to build security into a container? With least privilege micro services:
    • Namespaces that provide an isolated view of the system and isolate the resource usage
    • Use of minimal distros
    • Use of security profiles that are easily configurable
  • There is tooling to define per-container security profiles. E.g. Docker Bench: a container that tests containers and suggests changes to the security configuration