New-AzServiceFabricCluster

This command uses certificates that you provide or system generated self-signed certificates to set up a new service fabric cluster. It can use a default template or a custom template that you provide. You have the option of specifying a folder to export the self-signed certificates to or fetching them later from the key vault.

Syntax

New-AzServiceFabricCluster
   [-ResourceGroupName] <String>
   [-CertificateOutputFolder <String>]
   [-CertificatePassword <SecureString>]
   [-KeyVaultResourceGroupName <String>]
   [-KeyVaultName <String>]
   -Location <String>
   [-Name <String>]
   [-VmUserName <String>]
   [-ClusterSize <Int32>]
   [-CertificateSubjectName <String>]
   -VmPassword <SecureString>
   [-OS <OperatingSystem>]
   [-VmSku <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzServiceFabricCluster
   [-ResourceGroupName] <String>
   -TemplateFile <String>
   -ParameterFile <String>
   [-CertificateCommonName <String>]
   [-CertificateIssuerThumbprint <String>]
   [-VmPassword <SecureString>]
   -SecretIdentifier <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzServiceFabricCluster
   [-ResourceGroupName] <String>
   -TemplateFile <String>
   -ParameterFile <String>
   [-CertificateOutputFolder <String>]
   [-CertificatePassword <SecureString>]
   [-KeyVaultResourceGroupName <String>]
   [-KeyVaultName <String>]
   [-CertificateSubjectName <String>]
   [-VmPassword <SecureString>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzServiceFabricCluster
   [-ResourceGroupName] <String>
   -TemplateFile <String>
   -ParameterFile <String>
   -CertificateFile <String>
   [-CertificatePassword <SecureString>]
   [-SecondaryCertificateFile <String>]
   [-SecondaryCertificatePassword <SecureString>]
   [-KeyVaultResourceGroupName <String>]
   [-KeyVaultName <String>]
   [-CertificateCommonName <String>]
   [-CertificateIssuerThumbprint <String>]
   [-VmPassword <SecureString>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzServiceFabricCluster command uses certificates that you provide or system generated self-signed certificates to set up a new service fabric cluster. The template used can be a default template or a custom template that you provide. You have the option of specifying a folder to export the self-signed certificates or fetching them later from the key vault. If you are specifying a custom template and parameter file, you don't need to provide the certificate information in the parameter file, the system will populate these parameters. The four options are detailed below. Scroll down for explanations of each of the parameters.

Examples

Example 1: Specify only the cluster size, the cert subject name, and the OS to deploy a cluster.

$pass="Password#1234" | ConvertTo-SecureString -AsPlainText -Force
$RGname="test01"
$clusterloc="SouthCentralUS"
$subname="{0}.{1}.cloudapp.azure.com" -f $RGname, $clusterloc
$pfxfolder="c:\certs"

Write-Output "Create cluster in '$clusterloc' with cert subject name '$subname' and cert output path '$pfxfolder'"

New-AzServiceFabricCluster -ResourceGroupName $RGname -Location $clusterloc -ClusterSize 5 -VmPassword $pass -CertificateSubjectName $subname -CertificateOutputFolder $pfxfolder -CertificatePassword $pass -OS WindowsServer2016Datacenter

This command specifies only the cluster size, the cert subject name, and the OS to deploy a cluster.

Example 2: Specify an existing Certificate resource in a key vault and a custom template to deploy a cluster

$RGname="test20"
$templateParmfile="C:\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploytest.parameters.json"
$templateFile="C:\azure-quickstart-templates\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploy.json"
$secretId="https://test1.vault.azure.net:443/secrets/testcertificate4/56ec774dc61a462bbc645ffc9b4b225f"

New-AzServiceFabricCluster -ResourceGroupName $RGname -TemplateFile $templateFile -ParameterFile $templateParmfile -SecretIdentifier $secretId

This command specifies an existing Certificate resource in a key vault and a custom template to deploy a cluster.

Example 3: Create a new cluster using a custom template. Specify a different resource group name for the key vault and have the system upload a new certificate to it

$pass="Password#1234" | ConvertTo-SecureString -AsPlainText -Force
$RGname="test20"
$keyVaultRG="test20kvrg"
$keyVault="test20kv"
$clusterloc="SouthCentralUS"
$subname="{0}.{1}.$clusterloc.cloudapp.azure.com" -f $RGName, $clusterloc
$pfxfolder="~\Documents"
$templateParmfile="C:\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploytest.parameters.json"
$templateFile="C:\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploy.json"

New-AzServiceFabricCluster -ResourceGroupName $RGname -TemplateFile $templateFile -ParameterFile $templateParmfile -CertificateOutputFolder $pfxfolder -CertificatePassword $pass -KeyVaultResourceGroupName $keyVaultRG  -KeyVaultName $keyVault -CertificateSubjectName $subname

This command creates a new cluster using a custom template. Specify a different resource group name for the key vault and have the system upload a new certificate to it

Example 4: Bring your own Certificate and custom template and create a new cluster

$pass="Password#1234" | ConvertTo-SecureString -AsPlainText -Force
$RGname="test20"
$keyVaultRG="test20kvrg"
$keyVault="test20kv"
$pfxsourcefile="c:\Mycertificates\my2017Prodcert.pfx"
$templateParmfile="~\Documents\GitHub\azure-quickstart-templates-parms\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploytest.parameters.json"
$templateFile="~\GitHub\azure-quickstart-templates\service-fabric-secure-nsg-cluster-65-node-3-nodetype\azuredeploy.json"

New-AzServiceFabricCluster -ResourceGroupName $RGname -TemplateFile $templateFile -ParameterFile $templateParmfile -CertificateFile $pfxsourcefile -CertificatePassword $pass -KeyVaultResourceGroupName $keyVaultRG -KeyVaultName $keyVault

This command will let you bring your own Certificate and custom template and create a new cluster.

Parameters

-CertificateCommonName

Certificate common name

Type:String
Aliases:CertCommonName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateFile

The existing certificate file path for the primary cluster certificate

Type:String
Aliases:Source
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-CertificateIssuerThumbprint

Certificate issuer thumbprint, separated by commas if more than one

Type:String
Aliases:CertIssuerThumbprint
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateOutputFolder

The folder of the new certificate file to be created

Type:String
Aliases:Destination
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-CertificatePassword

The password of the certificate file

Type:SecureString
Aliases:CertPassword
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-CertificateSubjectName

The subject name of the certificate to be created

Type:String
Aliases:Subject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ClusterSize

The number of nodes in the cluster. Default are 5 nodes

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-KeyVaultName

Azure key vault name, if not given it will be defaulted to the resource group name

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-KeyVaultResourceGroupName

Azure key vault resource group name, if not given it will be defaulted to resource group name

Type:String
Aliases:KeyVaultResouceGroupName
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Location

The resource group location

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specify the name of the cluster, if not given it will be same as resource group name

Type:String
Aliases:ClusterName
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-OS

The Operating System of the VMs that make up the cluster.

Type:Microsoft.Azure.Commands.ServiceFabric.Models.OperatingSystem
Aliases:VmImage
Accepted values:WindowsServer2012R2Datacenter, WindowsServer2016Datacenter, WindowsServer2016DatacenterwithContainers, UbuntuServer1604
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ParameterFile

The path to the template parameter file.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ResourceGroupName

Specify the name of the resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SecondaryCertificateFile

The existing certificate file path for the secondary cluster certificate

Type:String
Aliases:SecSource
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-SecondaryCertificatePassword

The password of the certificate file

Type:SecureString
Aliases:SecCertPassword
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-SecretIdentifier

The existing Azure key vault secret URL, for example 'https://mykv.vault.azure.net:443/secrets/mysecrets/55ec7c4dc61a462bbc645ffc9b4b225f'

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-TemplateFile

The path to the template file.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VmPassword

The password of the Vm.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VmSku

The Vm Sku

Type:String
Aliases:Sku
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VmUserName

The user name for logging to Vm

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

SecureString

Int32

Microsoft.Azure.Commands.ServiceFabric.Models.OperatingSystem

Outputs

PSDeploymentResult