New-AzureCertificateSetting
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.
Required Parameters
Specifies the thumbprint of the certificate.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Optional Parameters
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an information variable.
| Type: | String |
| Aliases: | iv |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |