Here’s some brand new content from the SoftwareArchitect.ca YouTube channel that you might find interesting.
Azure Service Fabric is a new way of deploying applications into the cloud using microservices. You package and upload your applications to the Service Fabric, and Azure takes care of ensuring it’s using the resources of the cluster of servers it’s deployed on to.
In this video, I show you how to create a service fabric cluster, and deploy a sample application to it using Visual Studio 2017.
In this video, I show you how to create a Windows Web App in Microsoft Azure. Windows Web App. We go through the Azure Portal, and see how form fields get filled in. If you can’t afford to create resources in Azure, but want to see how it’s done in 2018, this is the video for you.
Or you can see the video directly on YouTube.
Well hi there, this is Scott Duffy. In this video we’re going to set up a service fabric cluster from scratch within the Azure portal. We’re going to use Visual Studio 2017 to deploy the service fabric application into it. So we’ve got a lot to do here, so let’s get into it.
So just so that you know, I’m going to be using the community edition of Visual Studio. The Visual Studio 2017 is downloadable free version of the Visual Studio IDE. You do need to prepare your environment by having the Microsoft Azure Service Fabric SDK. So if you just Google Microsoft Azure Service Fabric SDK, you can get to a page like this where you can download it and install the SDK.
We go into Microsoft Azure and we choose a service fabric cluster type from the marketplace. I’m going to say “create”. Now you give it a name; so I’m going to say AZ service fabric cluster and my initials. You’ll see here that it’s fully qualified, so it has to be unique. We get choice of operating system, there’s a couple of Linux versions and there’s a bunch of Windows versions. So I’m just going to pick the default which is the 2016 data center with containers. We have to enter user ID and password, so give me one second for that. We have to create a user resource group, since service fabric does create seven or eight different resources. I’m going to create a brand new resource group for that, and we give it a location.
The fundamental part of service fabric is you can have one, two, or three node types, and you have a quantity of nodes within each type. So we just need one node type for this example. We’re going to configure the required settings. I’m going to call this a basic node; there’s a very limited naming up to nine characters for the node type. I don’t need durability for this. Selecting the m size, I’m just going to take the smallest recommended size because this is only going to live for a couple of hours. Now we do have the option when we’re testing to try this single node cluster, but in this case I’m going to create a five node cluster. We do need to enable reverse proxy in order for the Visual Studio to be able to connect to this. So I’m going to say okay. Then I’m also going to say okay to that.
We do need to use a security key, so the security key is used for the publishing from Visual Studio. You are going to create a key, and you’re going to have to choose your key vault and give the certificate a name. When you click the okay button it’s going to go off and create a key and then you can download that key.
I’ve actually gone through this process already. I’m going to close out of this, and we’re going to go back to the home page. I’ve got a service fabric up and running that I just did a few minutes ago before starting this video. So the key to this, this is a three node fabric, not the five that I was trying to create before. But you’ll see here, you’ll see my nodes … It deployed successfully. Everything is up and running. I need to copy the client connection endpoint, because that is important. Let’s switch over to Visual Studio and we can see about this sample application that we’re going to be using.
Now for the code, I’m not going to create anything from scratch. I’ve chosen from the Azure samples GitHub repository, the service fabric dot net getting started sample. So download this and go into Visual Studio with it. This is Visual Studio, this is the code. This is deployment, but this is the package that comes with it. There’s a lot of different applications, web services, stateful and stateless, actor, et cetera. We’re going to go into the getting started application. We’re going to build it. Make sure that it builds on your local first, obviously. It builds on mine. Then I’m going to say “publish”. Now the key here is to put the correct connection endpoint that we took from the portal here into the connection endpoint. The other key is that we have to install the key that we downloaded from the Azure portal. So if I go into my documents here, I downloaded the key from the Azure portal. Let’s look at it within the key vault.
So I have the key that I downloaded from Azure. I can click “install” and I want to make sure that it’s installed as a machine certificate into my personal certificate store, so you can see here that it is installed as a machine certificate. We’ll see that with a restarted Visual Studio that the connection endpoint is accepted, there’s a green check mark. If I was to click the publish link, which I will do, it will build this solution and will start to publishing into the service fabric cluster. So that’s going to take a few minutes actually, so let’s pause the video and we’ll come back when it’s deployed.
So just watching the deployment about to finish up here. I can see that it’s now deploying of the individual projects within this file. So we can see that this web service is ready. The publication succeeded. That took just over one minute to deploy.
Now if you go into the portal, you’ll see there’s this service fabric explorer. If you’re able to get into there, then you’ll see that … Look at that. We have our getting started application deployed into our three node service fabric. Yeah, Microsoft’s Azure Service Fabric is now managing the running of this application, distributing it within the three nodes. If we were to start to hammer the performance of one of these, it would then distribute more services to make up for it.
That’s pretty much what I wanted to show you. This is a creation and a deployment of a service fabric app into the Microsoft Azure Service Fabric. If you like this video, let me know. If you have questions, of course, let me know. Thanks.