Visual Studio provides templates to build Azure Service Fabric application. Let us open Visual Studio and get started. Open Visual Studio and click on Create a new project. Please note that this demonstration is being done using Visual Studio 2019.
Select API and click on Create. The project gets created.
Now, let us run the project. The Web API project runs and we have output from the values controller that got created when we created the project.
We will have a detailed code walkthrough in the next article where we will dive into all code essentials. Let us park the code stuff as of now. When we run this project in Visual Studio then below steps are executed.
Step 1
Code gets compiled.
Step 2
A PowerShell script which got generated in this project will execute and deploy the Service Fabric Application to the local Service Fabric Cluster.
Step 3
The values controller gets invoked post deployment to the Cluster.
Service Fabric Cluster Manager is important tooling that helps in managing the Service Fabric Cluster. It acts as an orchestrator and takes care of important aspects like service health monitoring, load balancing, application and node management, and other priority aspects.
Let us get into the Local Cluster Manager and inspect our deployed API. Double Click on Service Fabric application icon in the System Tray.
The Cluster Manager will open up in the Web Browser. We can see we have one application hosted on a single node. The service is hosted on a single partition and a single replica. We can see that the application and the node are healthy. This is the same application we built and hosted some time back.
Let us expand the Cluster and the Application. We can see that our application is listed. Click on our application. We can navigate across each of the tabs – Essentials, Details, Deployments, Manifest, and Events and get insights on the application.
Essentials tab has all the essential information summarized for the Service Fabric. Deployments tab provides information on the nodes where the application is deployed along with the Health Status. Manifest tab highlights the application manifest information.
Expanding the Nodes tree will give details on the Node where the application is hosted along with the Instance Information. Here we have hosted it on a single node and we see that listed here.
Winding-up
In this article, we created a Stateless Service Fabric application. We executed the application and hosted it on the Service Fabric Local Cluster. We had a brief understanding of the Service Fabric Cluster.
However, we have not explored the Service Fabric code yet. We will do this in the next article.