Get started with Azure Fabric

Rebai Hamida
6 min readMay 12, 2020
Azure Fabric

Introduction

In a changing market, one of the main challenges of maintaining the competitiveness of digital businesses remains IT agility. However, in their current state, computer systems are struggling to adapt to the latest technological developments such as mobility or the Internet of Things and to their new requirements. With a large number of interdependencies of services linked to the life cycle of an IT project, each modification of the source code of a classic monolithic application can destabilize it in maintenance.

For this reason, companies have resorted to more optimized, scalable architectures, ensuring continuous availability and less costly in terms of resource consumption and in particular oriented “microservices”. This change is essential facing the aggressive competition, and in particular that of start-ups which are not yet congested by rigid infrastructure.

Microservices

Microservices are very similar to bee hives. Within a hive, thousands of bees coexist and help each other for a single common goal: the survival of the colony. The queen, the workers and the drones each have their peculiarities and must therefore assume very distinct tasks.

Challenges building cloud applications

Companies face challenges in their passage to the Cloud because for example there is the optimization of the development of microservices to be taken into account, similarly, achieving reliable consistency of state and data without latency problems, Monitoring and governance at global and granular levels, Execution of highly secure applications on a large scale, until integration and continuous development.

Microsoft Azure, include quite a few PaaS services to host and deploy microservices.

PaaS vs CaaS vs FaaS

There are three major services in Azure, there is Service Fabric which we will see in more detail during our session today, it supports microservices developed by any language and Service Fabric Mesh offers more features intelligent routing, we also have Azure Container Instance as a container abd Azure Kubernetes which is a container orchestrator containing microservices easy to manage, and finally we have Azure Functions which is part of the services will act according to the triggers.

Service Fabric overview

“Azure Service Fabric is a distributed systems platform that facilitates the packaging, deployment and management of scalable and reliable containers and microservices. Service Fabric also solves the significant problems of developing and managing native cloud applications. Developers and administrators are able to avoid complex infrastructure issues and can focus on implementing strategic and demanding workloads that are scalable, reliable, and easy to manage.”

Service Fabric Cluster structure

Service Fabric cluster: a network-connected set of virtual machines (VMs) into which your microservices are deployed and managed.

A cluster is a set of nodes that are VMs, node numbers depends from the use of clusters, in development phase, one node is used but in production, you need to have more than 5.

Every node has an operating system windows or linux with a runtime. A node can host multiples applications it depend from the resource available in the virtual machine.

Nodes in a cluster

Powering Azure and Microsoft services

Service Fabric is an open source project and is used in many Azure infrastructure services as well as other Microsoft services, including Azure Event Hubs, Azure Cosmos DB, Azure SQL DB, Dynamic 365 and Cortana. The main subsections of Service Fabric can be seen below.

Monitoring and diagnostics

Monitoring and diagnostics are critical to developing, testing, and deploying workloads in any cloud environment. For example, you can track how your applications are used, the actions taken by the Service Fabric platform, your resource utilization with performance counters, and the overall health of your cluster. You can use this information to diagnose and correct issues, and prevent them from occurring in the future.

Monitoring and diagnostics

Prerequisites Environment

  • Windows 10 is required for Docker installation.
  • Visual Studio 2019 or 2017 has built-in support for Docker
  • .NET Core SDK
  • SDK Microsoft Service Fabric
  • Docker for Windows (optional)
  • Docker Tools(optional)

1- Set up your windows development environment to buid Service Fabric

Install Visual Studio 2019

To use Visual Studio 2017 or 2019

Install the Microsoft Azure Service Fabric SDK

To use Visual Studio 2015 (requires Visual Studio 2015 Update 2 or later)

Install the Microsoft Azure Service Fabric SDK and Tools

SDK installation only

If you only need the SDK, you can install this package:

Install the Microsoft Azure Service Fabric SDK

Microsoft Azure Fabric SDK
Microsoft Azure Fabric SDK

In Visual Studio 2019, we will check Service Fabric template:

Visual Studio Service Fabric Template
Statefull or Stateless services

We will start Service Fabric Local Cluster:

And in the bottom, we will click on the icon of Service Fabric to launch Service Fabric Explorer, to do that choose Manage Local Cluster:

Service Fabric Explorer

When we create a new project, we can choose Stateless services for example to see how we can deploy an application as a service fabric, we go back to Visual Studio to create an empty project using the template:

Create a new stateless service
Service Fabric project

We will build the solution to deploy a first application in Service Fabric Explorer:

Build a project

We will check our application in Service Fabric Explorer:

Publish a Service Fabric in Visual Studio 2019

Create a new ASP.NET Core Web Application

We can clone a sample from GitHub: https://github.com/Azure-Samples/service-fabric-dotnet-quickstart

Deploy a Service Fabric application to a cluster in Azure

To deploy to Azure, we click on publish to create Service Fabric Cluster.

We will open Azure:

--

--

Rebai Hamida

Senior Cloud Application Architect, Microsoft MVP in Developer Technologies, MCT, Technical writer, Speaker