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
ByDefaultArmTemplate (Default)
New-AzServiceFabricCluster
[-ResourceGroupName] <String>
-Location <String>
-VmPassword <SecureString>
[-CertificateOutputFolder <String>]
[-CertificatePassword <SecureString>]
[-KeyVaultResourceGroupName <String>]
[-KeyVaultName <String>]
[-Name <String>]
[-VmUserName <String>]
[-ClusterSize <Int32>]
[-CertificateSubjectName <String>]
[-OS <OperatingSystem>]
[-VmSku <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByExistingKeyVault
New-AzServiceFabricCluster
[-ResourceGroupName] <String>
-TemplateFile <String>
-ParameterFile <String>
-SecretIdentifier <String>
[-CertificateCommonName <String>]
[-CertificateIssuerThumbprint <String>]
[-VmPassword <SecureString>]
[-Thumbprint <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByNewPfxAndVaultName
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>]
ByExistingPfxAndVaultName
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
$password = ConvertTo-SecureString -String "****" -AsPlainText -Force
$resourceGroupName = "quickstart-sf-group"
$azureRegion = "southcentralus"
$clusterDnsName = "{0}.{1}.cloudapp.azure.com" -f $resourceGroupName, $azureRegion
$localCertificateFolder = "c:\certs"
Write-Output "Create cluster in '$azureRegion' with cert subject name '$clusterDnsName' and cert output path '$localCertificateFolder'"
New-AzServiceFabricCluster -ResourceGroupName $resourceGroupName -Location $azureRegion -ClusterSize 5 -VmPassword $password -CertificateSubjectName $clusterDnsName -CertificateOutputFolder $localCertificateFolder -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
$resourceGroupName = "test20"
$templateParameterFile = "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 $resourceGroupName -TemplateFile $templateFile -ParameterFile $templateParameterFile -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
$password = ConvertTo-SecureString -String "****" -AsPlainText -Force
$resourceGroupName = "quickstart-sf-group"
$keyVaultResourceGroupName = " quickstart-kv-group"
$keyVaultName = "quickstart-kv"
$azureRegion = "southcentralus"
$clusterDnsName = "{0}.{1}.cloudapp.azure.com" -F $resourceGroupName, $azureRegion
$localCertificateFolder = "~\Documents"
$templateParameterFile = "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 $resourceGroupName -TemplateFile $templateFile -ParameterFile $templateParameterFile -CertificateOutputFolder $localCertificateFolder -CertificatePassword $password -KeyVaultResourceGroupName $keyVaultResourceGroupName -KeyVaultName $keyVaultName -CertificateSubjectName $clusterDnsName
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
$password = ConvertTo-SecureString -String "****" -AsPlainText -Force
$resourceGroupName = "test20"
$keyVaultResourceGroupName = "test20kvrg"
$keyVaultName = "test20kv"
$localCertificateFile = "c:\Mycertificates\my2017Prodcert.pfx"
$templateParameterFile = "~\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 $resourceGroupName -TemplateFile $templateFile -ParameterFile $templateParameterFile -CertificateFile $localCertificateFile -CertificatePassword $password -KeyVaultResourceGroupName $keyVaultResourceGroupName -KeyVaultName $keyVaultName
This command will let you bring your own Certificate and custom template and create a new cluster.
Parameters
-CertificateCommonName
Certificate common name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: CertCommonName
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateFile
The existing certificate file path for the primary cluster certificate
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Source
Parameter sets
ByExistingPfxAndVaultName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateIssuerThumbprint
Certificate issuer thumbprint, separated by commas if more than one
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: CertIssuerThumbprint
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateOutputFolder
The folder of the new certificate file to be created
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Destination
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificatePassword
The password of the certificate file
Parameter properties
Type: SecureString
Default value: None
Supports wildcards: False
DontShow: False
Aliases: CertPassword
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateSubjectName
The subject name of the certificate to be created
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Subject
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-ClusterSize
The number of nodes in the cluster.
Default are 5 nodes
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyVaultName
Azure key vault name, if not given it will be defaulted to the resource group name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyVaultResourceGroupName
Azure key vault resource group name, if not given it will be defaulted to resource group name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: KeyVaultResourceGroupName
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Location
The resource group ___location
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Specify the name of the cluster, if not given it will be same as resource group name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ClusterName
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-OS
The Operating System of the VMs that make up the cluster.
Parameter properties
Type: OperatingSystem
Default value: None
Accepted values: WindowsServer2012R2Datacenter, WindowsServer2016Datacenter, WindowsServer2016DatacenterwithContainers, UbuntuServer1604, UbuntuServer1804, UbuntuServer2004, WindowsServer2022
Supports wildcards: False
DontShow: False
Aliases: VmImage
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ParameterFile
The path to the template parameter file.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Specify the name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-SecondaryCertificateFile
The existing certificate file path for the secondary cluster certificate
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: SecSource
Parameter sets
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-SecondaryCertificatePassword
The password of the certificate file
Parameter properties
Type: SecureString
Default value: None
Supports wildcards: False
DontShow: False
Aliases: SecCertPassword
Parameter sets
ByExistingPfxAndVaultName
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-SecretIdentifier
The existing Azure key vault secret URL, for example 'https://mykv.vault.azure.net:443/secrets/mysecrets/55ec7c4dc61a462bbc645ffc9b4b225f'
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-TemplateFile
The path to the template file.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByNewPfxAndVaultName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
ByExistingPfxAndVaultName
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Thumbprint
The thumbprint for the certificate corresponding to the SecretIdentifier. Use this if the certificate is not managed as the key vault would only have the certificate stored as a secret and the cmdlet is unable to retrieve the thumbprint.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByExistingKeyVault
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-VmPassword
The password of the Vm.
Parameter properties
Type: SecureString
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-VmSku
The Vm Sku
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Sku
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-VmUserName
The user name for logging to Vm
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByDefaultArmTemplate
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs