Add-AzureRmServiceFabricClusterCertificate

Add a secondary cluster certificate to the cluster.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Add-AzureRmServiceFabricClusterCertificate
   [-ResourceGroupName] <String>
   [-Name] <String>
   -SecretIdentifier <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzureRmServiceFabricClusterCertificate
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-KeyVaultResouceGroupName <String>]
   [-KeyVaultName <String>]
   [-CertificateOutputFolder <String>]
   [-CertificatePassword <SecureString>]
   -CertificateSubjectName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzureRmServiceFabricClusterCertificate
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-KeyVaultResouceGroupName <String>]
   [-KeyVaultName <String>]
   -CertificateFile <String>
   [-CertificatePassword <SecureString>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use Add-AzureRmServiceFabricClusterCertificate to add a secondary cluster certificate, either from an existing Azure key vault or creating a new Azure key vault using an existing certificate provided or from a new self-signed certificate created. It will override the secondary cluster if there is any.

Examples

Example 1

Add-AzureRmServiceFabricClusterCertificate -ResourceGroupName 'Group1' -Name 'Contoso01SFCluster' 
-SecretIdentifier 'https://contoso03vault.vault.azure.net/secrets/contoso03vaultrg/7f7de9131c034172b9df37ccc549524f'

This command will add a certificate in the existing Azure key vault as a secondary cluster certificate.

Example 2

PS c:\> $pwd = ConvertTo-SecureString -String "123" -AsPlainText -Force
PS c:\> add-AzureRmServiceFabricClusterCertificate -ResourceGroupName 'Group2' -Name 'Contoso02SFCluster'  -CertificateSubjectName 'Contoso.com' 
-CertificateOutputFolder 'c:\test' -CertificatePassword $pwd

This command will create a self-signed certificate in the Azure key vault and upgrade the cluster to use it as a secondary cluster certificate.

Parameters

-CertificateFile

The existing certificate file path.

Type:String
Aliases:Source
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-CertificateOutputFolder

The folder of the new certificate to be created.

Type:String
Aliases:Destination
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-CertificatePassword

The password of the certificate file.

Type:SecureString
Aliases:CertPassword
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-CertificateSubjectName

The Dns name of the certificate to be created.

Type:String
Aliases:Subject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyVaultName

Azure key vault name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-KeyVaultResouceGroupName

Azure key vault resource group name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specify the name of the cluster.

Type:String
Aliases:ClusterName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SecretIdentifier

The existing Azure key vault secret Url.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Parameters: CertificateFile (ByValue), CertificateOutputFolder (ByValue), CertificateSubjectName (ByValue), KeyVaultName (ByValue), KeyVaultResouceGroupName (ByValue), SecretIdentifier (ByValue)

SecureString

Parameters: CertificatePassword (ByValue)

Outputs

PSCluster