New-AzBatchCertificate
Adds a certificate to the specified Batch account.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzBatchCertificate
[-FilePath] <String>
[-Password <SecureString>]
[-Kind <PSCertificateKind>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzBatchCertificate
[-RawData] <Byte[]>
[-Password <SecureString>]
[-Kind <PSCertificateKind>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The New-AzBatchCertificate cmdlet adds a certificate to the specified Azure Batch account.
Examples
Example 1: Add a certificate from a file
PS C:\>New-AzBatchCertificate -FilePath "E:\Certificates\MyCert.cer" -BatchContext $Context
This command adds a certificate to the specified Batch account by using the file E:\Certificates\MyCert.cer.
Example 2: Add a certificate from raw data
PS C:\>$RawData = [System.IO.File]::ReadAllBytes("E:\Certificates\MyCert.pfx")
PS C:\> New-AzBatchCertificate -RawData $RawData -Password "Password1234" -BatchContext $Context
The first command reads the data from the file named MyCert.pfx into the $RawData variable. The second command adds a certificate to the specified Batch account using the raw data stored in $RawData.
Parameters
Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Azure Active Directory authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.
| Type: | BatchAccountContext |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the path of the certificate file. The certificate file must be in either .cer or .pfx format.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The kind of certificate to create. If this is not specified, it is assumed that all certificates without a password are CER and all certificates with password are PFX.
| Type: | PSCertificateKind |
| Accepted values: | Cer, Pfx |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the password to access the certificate private key. You must specify this parameter if you specify a certificate in .pfx format.
| Type: | SecureString |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the raw certificate data in either .cer or .pfx format.
| Type: | Byte[] |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Inputs
Byte[]