Microsoft Azure Tutorial for Beginners – Part 2

By | November 28, 2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest

How to create a simple Windows Communication Foundation (WCF) Service for Azure Service Fabric. Creating a client to call it, and a demonstration of the upgrading the service in real-time.

Azure Service Fabric is either a stateless or state full compute service that manages the execution, lifetime, and complexity part and code components. We can design micro service based architecture by using Service Fabric.

In Part-1 of this Microsoft Azure Tutorial Series for beginners, we covered all basic concepts related to cloud computing, Microsoft Azure as cloud computing platform, Comparing with other Cloud platforms and details about Microsoft Azure Services. Also, a step by step example to create a Virtual Machine on Microsoft Azure.

Here, we can explain how we create a simple “Windows Communication Foundation (WCF)” service using Service Fabrics “Stateless Service” and publish it to “Service Fabrics” local cluster. We are creating the project solution in Visual Studio 2015.

You can install service fabrics in your system by using Web Platform Installer 5.0 as bellows.Web Platform Installer

After successfully installation of Microsoft Azure Service Fabrics component follow below steps.

  1. Open the “Visual Studio 2015”.
  2. Create new project as below:
    Azure Service Fabrics Tutorial
  3. Click “OK” button. Next window display as below.Microsoft Azure Service Tutorial
  4. Select “Stateless Service”.
  5. See the whole application solution and architecture as below.WCF Service in Visual Studio 2015

Here, we can create a zip code service; we create two service functions for that.

  1. Get City based on the zip code.
  2. Get the list of all the Cities.

Taught by:

  • Roy H. Campbell, Professor of Computer Science.
  • Reza Farivar, Data Engineering Manager at Capital One, Adjunct Research Assistant Professor of Computer Science.

Cloud Computing Application Online Course covers multitude of technologies comprising latest concepts of Cloud Computing.

Let’s Dive into Source Code for Microsoft Azure Tutorial:

We have created one new project called “Contract”, it is referenced in “ZipCodeService” as well as “ServiceClient” project. Now we have mentioned the project wise code as below.

Contract Project:

ZipCodeService Project

For this project you need to installed the nugget package

<package id=”Microsoft.ServiceFabric.Services.Wcf” version=”2.8.232″ targetFramework=”net452″ />

Also reference the “Contract” project.

Now, simple wcf service for service fabrics is ready. For publishing the wcf service, you need to build the solution and if the solution build successfully, right click the “AzureServiceFabrics.WCF” project and click on publish. The below screen display when you click on “Publish.

Publish Local Fabric Service

Click on “Publish” Button.

After publish successfully, double click on Service Fabrics icon from window system tray, as display below:Service Fabric Explorer

Above screen display the Service Fabrics Explorer, in which you can see your wcf services.

70-532 Developing Microsoft Azure Solutions Certification
70-532 Developing Microsoft Azure Solutions Certification
The most complete course available on the Microsoft Azure updated developer exam and certification.
70-534 Architecting Microsoft Azure Solutions Certification
70-534 Architecting Microsoft Azure Solutions Certification
Get Azure certified as an architect in one of Microsoft’s newest certifications on the hottest cloud platform Azure.

View All Training and Certification Courses

Now, we have create a one console application that works as a Service Client for consuming our newly created zip code service. In above solution, we have create “ZipCodeServiceClient” project for same.

ZipCodeServiceClient:

Build the solution. Right click on ServiceClient project and “set as a start project”. Run the “Service Client” project. The output will display like below:Azure Service Fabric Client Output

For upgrading wcf service is very easy. When you have made a changes in your wcf service code, then publish it again by clicking “Upgrade The Application” check box during publish.

In this Microsoft Azure Tutorial, we explain the creating wcf service with service fabrics and create a client for consuming the wcf service. Here, we used stateless services. There are various other options for creating service fabrics application.

Take this Microsoft Azure Course at Discounted Price

More Microsoft Azure Tutorials and Cloud Computing Training Courses
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest