< Back

New-AzureRmServiceFabricCluster

Tue Jan 29, 2019 10:07 pm

NAME New-AzureRmServiceFabricCluster



SYNOPSIS

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-AzureRmServiceFabricCluster [-ResourceGroupName] <String> -CertificateFile <String> [-CertificatePassword <SecureString>] [-DefaultProfile

<IAzureContextContainer>] [-KeyVaultName <String>] [-KeyVaultResouceGroupName <String>] -ParameterFile <String> [-SecondaryCertificateFile

<String>] [-SecondaryCertificatePassword <SecureString>] -TemplateFile <String> [-VmPassword <SecureString>] [-Confirm] [-WhatIf]

[<CommonParameters>]



New-AzureRmServiceFabricCluster [-ResourceGroupName] <String> [-CertificateOutputFolder <String>] [-CertificatePassword <SecureString>]

[-CertificateSubjectName <String>] [-ClusterSize <Int32>] [-DefaultProfile <IAzureContextContainer>] [-KeyVaultName <String>]

[-KeyVaultResouceGroupName <String>] -Location <String> [-Name <String>] [-OS {WindowsServer2012R2Datacenter | WindowsServer2016Datacenter |

WindowsServer2016DatacenterwithContainers | UbuntuServer1604}] -VmPassword <SecureString> [-VmSku <String>] [-VmUserName <String>] [-Confirm]

[-WhatIf] [<CommonParameters>]



New-AzureRmServiceFabricCluster [-ResourceGroupName] <String> [-CertificateOutputFolder <String>] [-CertificatePassword <SecureString>]

[-CertificateSubjectName <String>] [-DefaultProfile <IAzureContextContainer>] [-KeyVaultName <String>] [-KeyVaultResouceGroupName <String>]

-ParameterFile <String> -TemplateFile <String> [-VmPassword <SecureString>] [-Confirm] [-WhatIf] [<CommonParameters>]



New-AzureRmServiceFabricCluster [-ResourceGroupName] <String> [-DefaultProfile <IAzureContextContainer>] -ParameterFile <String> -SecretIdentifier

<String> -TemplateFile <String> [-VmPassword <SecureString>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The New-AzureRmServiceFabricCluster 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.





PARAMETERS

-CertificateFile <String>

The existing certificate file path for the primary cluster certificate.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-CertificateOutputFolder <String>

The folder of the new certificate file to be created.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-CertificatePassword <SecureString>

The password of the certificate file.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-CertificateSubjectName <String>

The subject name of the certificate to be created.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ClusterSize <Int32>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-KeyVaultName <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-KeyVaultResouceGroupName <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Location <String>

The resource group location.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Name <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-OS <OperatingSystem>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ParameterFile <String>

The path to the template parameter file.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ResourceGroupName <String>

Specify the name of the resource group.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SecondaryCertificateFile <String>

The existing certificate file path for the secondary cluster certificate.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-SecondaryCertificatePassword <SecureString>

The password of the certificate file.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-SecretIdentifier <String>

The existing Azure key vault secret URL, for example: 'https://mykv.vault.azure.net:443/secret ... fc9b4b225f'.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-TemplateFile <String>

The path to the template file.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-VmPassword <SecureString>

The password of the Vm.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VmSku <String>

The Vm Sku.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VmUserName <String>

The user name for logging to Vm.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

System.Security.SecureString System.Int32 Microsoft.Azure.Commands.ServiceFabric.Models.OperatingSystem





OUTPUTS

Microsoft.Azure.Commands.ServiceFabric.Models.PSDeploymentResult







NOTES









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="~\\Documents"



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



New-AzureRmServiceFabricCluster -ResourceGroupName $RGname -Location $clusterloc -ClusterSize 3 -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/secre ... fc9b4b225f"



New-AzureRmServiceFabricCluster -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-AzureRmServiceFabricCluster -ResourceGroupName $RGname -TemplateFile $templateFile -ParameterFile $templateParmfile -CertificateOutputFolder

$pfxfolder -CertificatePassword $pass -KeyVaultResouceGroupName $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.paramet

ers.json"

$templateFile="~\\GitHub\\azure-quickstart-templates\\service-fabric-secure-nsg-cluster-65-node-3-nodetype\\azuredeploy.json"



New-AzureRmServiceFabricCluster -ResourceGroupName $RGname -TemplateFile $templateFile -ParameterFile $templateParmfile -CertificateFile

$pfxsourcefile -CertificatePassword $pass -KeyVaultResouceGroupName $keyVaultRG -KeyVaultName $keyVault



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







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... riccluster