New-AzureCertificateSetting

Creates a certificate setting object for a certificate is in a service.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Important

Cloud Services (classic) is now deprecated for new customers and will be retired on August 31st, 2024 for all customers. New deployments should use the new Azure Resource Manager based deployment model Azure Cloud Services (extended support).

Syntax

New-AzureCertificateSetting
   [[-StoreName] <String>]
   [-Thumbprint] <String>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The New-AzureCertificateSetting cmdlet creates a certificate setting object for a certificate that is in an Azure service.

You can use a certificate setting object to create a configuration object by using the Add-AzureProvisioningConfig cmdlet. Use a configuration object to create virtual machine by using the New-AzureVM cmdlet. You can use a certificate setting object to create a virtual machine by using the New-AzureQuickVM cmdlet.

Examples

Example 1: Create a certificate setting object

PS C:\> New-AzureCertificateSetting -Thumbprint "D7BECD4D63EBAF86023BB41FA5FBF5C2C924902A" -StoreName "My"

This command creates a certificate setting object for an existing certificate.

Example 2: Create a virtual machine that uses a configuration setting object

PS C:\> Add-AzureCertificate -ServiceName "ContosoService" -CertToDeploy "C:\temp\ContosoCert.cer"
PS C:\> $CertificateSetting = New-AzureCertificateSetting -Thumbprint "D7BECD4D63EBAF86023BB41FA5FBF5C2C924902A" -StoreName "My" 
PS C:\> $Image = Get-AzureVMImage -ImageName "ContosoStandard"
PS C:\> New-AzureVMConfig -Name "VirtualMachine17" -InstanceSize Small -ImageName $Image | Add-AzureProvisioningConfig -Windows -Certificates $CertificateSetting -Password "password" | New-AzureVM -ServiceName "ContosoService"

The first command adds the certificate ContosoCert.cer to the service named ContosoService by using the Add-AzureCertificate cmdlet.

The second command creates a certificate setting object, and then stores it in the $CertificateSetting variable.

The third command gets an image from the image repository by using the Get-AzureVMImage cmdlet. This command store the image in the $Image variable.

The final command creates a virtual machine configuration object based on the image in $Image by using the New-AzureVMConfig cmdlet. The command passes that object to the Add-AzureProvisioningConfig cmdlet by using the pipeline operator. That cmdlet add provisioning information to the configuration. The command passes the object to the New-AzureVM cmdlet, which creates the virtual machine.

Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-StoreName

Specifies the certificate store in which to put the certificate. Valid values are:

  • AddressBook
  • AuthRoot
  • CertificateAuthority
  • Disallowed
  • My
  • Root
  • TrustedPeople
  • TrustedPublisher
Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Thumbprint

Specifies the thumbprint of the certificate.

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