New-AzBatchCertificate
Adds a certificate to the specified Batch account.
Syntax
File (Default)
New-AzBatchCertificate
[-FilePath] <String>
-BatchContext <BatchAccountContext>
[-Password <SecureString>]
[-Kind <PSCertificateKind>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
RawData
New-AzBatchCertificate
[-RawData] <Byte[]>
-BatchContext <BatchAccountContext>
[-Password <SecureString>]
[-Kind <PSCertificateKind>]
[-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
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
$RawData = [System.IO.File]::ReadAllBytes("E:\Certificates\MyCert.pfx")
New-AzBatchCertificate -RawData $RawData -Password <Password> -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
-BatchContext
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 Microsoft Entra 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.
Parameter properties
Type: | BatchAccountContext |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
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 |
-FilePath
Specifies the path of the certificate file. The certificate file must be in either .cer or .pfx format.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
File
Position: | 0 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Kind
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.
Parameter properties
Type: | PSCertificateKind |
Default value: | None |
Accepted values: | Cer, Pfx |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Password
Specifies the password to access the certificate private key. You must specify this parameter if you specify a certificate in .pfx format.
Parameter properties
Type: | SecureString |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-RawData
Specifies the raw certificate data in either .cer or .pfx format.
Parameter properties
Type: | Byte[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
RawData
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
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.