Tutorial: Deploy a Service Fabric managed cluster
In this tutorial series, we discuss:
- How to deploy a Service Fabric managed cluster
- How to scale out a Service Fabric managed cluster
- How to add and remove nodes in a Service Fabric managed cluster
- How to deploy an application to a Service Fabric managed cluster
This part of the series covers how to:
- Connect to your Azure account
- Create a new resource group
- Deploy a Service Fabric managed cluster
- Add a Primary node type to the cluster
Prerequisites
Before you begin this tutorial:
Create a trial subscription if you don't already have an Azure subscription.
Install the Service Fabric SDK and PowerShell module.
Install Azure PowerShell 4.7.0 (or later).
Connect to your Azure account
Replace <your-subscription>
with the subscription string for your Azure account, and connect:
Connect-AzAccount -Environment AzureChinaCloud
Set-AzContext -SubscriptionId <your-subscription>
Create a new resource group
Next, create the resource group for the Managed Service Fabric cluster, replacing <your-rg>
and <location>
with the desired group name and location.
$resourceGroup = "myResourceGroup"
$location = "ChinaEast2"
New-AzResourceGroup -Name $resourceGroup -Location $location
Deploy a Service Fabric managed cluster
Create a Service Fabric managed cluster
In this step, you create a Service Fabric managed cluster using the New-AzServiceFabricManagedCluster PowerShell command. The following example creates a cluster named myCluster in the resource group named myResourceGroup. This resource group was created in the previous step in the chinaeast2 region.
For this step, provide your own values for the following parameters:
- Cluster Name: Enter a unique name for your cluster, such as mysfcluster.
- Admin Password: Enter a password for the admin to be used for Remote Desktop Protocol (RDP) on the underlying VMs in the cluster.
- Client Certificate Thumbprint: Provide the thumbprint of the client certificate that you would like to use to access your cluster. If you don't have a certificate, follow set and retrieve a certificate to create a self-signed certificate.
- Cluster SKU: Specify the type of Service Fabric managed cluster to deploy. Basic SKU clusters are meant for test deployments only, and don't allow for node type addition or removal.
$clusterName = "<unique cluster name>"
$password = "Password4321!@#" | ConvertTo-SecureString -AsPlainText -Force
$clientThumbprint = "<certificate thumbprint>"
$clusterSku = "Standard"
New-AzServiceFabricManagedCluster -ResourceGroupName $resourceGroup -Location $location -ClusterName $clusterName -ClientCertThumbprint $clientThumbprint -ClientCertIsAdmin -AdminPassword $password -Sku $clusterSKU -Verbose
Add a primary node type to the Service Fabric managed cluster
In this step, you add a primary node type to the cluster that you created. Every Service Fabric cluster must have at least one primary node type.
For this step, provide your own values for the following parameters:
- Node Type Name: Enter a unique name for the node type to be added to your cluster, such as "NT1".
Note
If the node type being added is the first or only node type in the cluster, the Primary property must be used.
$nodeType1Name = "NT1"
New-AzServiceFabricManagedNodeType -ResourceGroupName $resourceGroup -ClusterName $clusterName -Name $nodeType1Name -Primary -InstanceCount 5
This command may take a few minutes to complete.
Validate the deployment
Review deployed resources
Once the deployment completes, find the Service Fabric Explorer value in the Service Fabric managed cluster resource overview page in Portal. When prompted for a certificate, use the certificate for which the client thumbprint was provided in the PowerShell command.
Important
Manually making changes to the resources in a managed cluster isn't supported.
Next steps
In this step we created and deployed our first Service Fabric managed cluster. To learn more about how to scale a cluster, see: