< Back
New-AzureBatchCertificate
Post
NAME New-AzureBatchCertificate
SYNOPSIS
Adds a certificate to the specified Batch account.
SYNTAX
New-AzureBatchCertificate [-FilePath] <String> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Password
<SecureString>] [<CommonParameters>]
New-AzureBatchCertificate [-RawData] <Byte[]> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Password
<SecureString>] [<CommonParameters>]
DESCRIPTION
The New-AzureBatchCertificate cmdlet adds a certificate to the specified Azure Batch account.
PARAMETERS
-BatchContext <BatchAccountContext>
Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzureRmBatchAccount
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-AzureRmBatchAccountKeys 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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-FilePath <String>
Specifies the path of the certificate file. The certificate file must be in either .cer or .pfx format.
Required? true
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Password <SecureString>
Specifies the password to access the certificate private key. You must specify this parameter if you specify a certificate in .pfx format.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-RawData <Byte[]>
Specifies the raw certificate data in either .cer or .pfx format.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
BatchAccountContext
Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline
Byte[]
Parameter 'RawData' accepts value of type 'Byte[]' from the pipeline
OUTPUTS
NOTES
Example 1: Add a certificate from a file
PS C:\\>New-AzureBatchCertificate -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-AzureBatchCertificate -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.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ertificate
Get-AzureBatchCertificate
Get-AzureRmBatchAccountKeys
Remove-AzureBatchCertificate
Azure Batch Cmdlets
SYNOPSIS
Adds a certificate to the specified Batch account.
SYNTAX
New-AzureBatchCertificate [-FilePath] <String> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Password
<SecureString>] [<CommonParameters>]
New-AzureBatchCertificate [-RawData] <Byte[]> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Password
<SecureString>] [<CommonParameters>]
DESCRIPTION
The New-AzureBatchCertificate cmdlet adds a certificate to the specified Azure Batch account.
PARAMETERS
-BatchContext <BatchAccountContext>
Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzureRmBatchAccount
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-AzureRmBatchAccountKeys 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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-FilePath <String>
Specifies the path of the certificate file. The certificate file must be in either .cer or .pfx format.
Required? true
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Password <SecureString>
Specifies the password to access the certificate private key. You must specify this parameter if you specify a certificate in .pfx format.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-RawData <Byte[]>
Specifies the raw certificate data in either .cer or .pfx format.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
BatchAccountContext
Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline
Byte[]
Parameter 'RawData' accepts value of type 'Byte[]' from the pipeline
OUTPUTS
NOTES
Example 1: Add a certificate from a file
PS C:\\>New-AzureBatchCertificate -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-AzureBatchCertificate -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.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ertificate
Get-AzureBatchCertificate
Get-AzureRmBatchAccountKeys
Remove-AzureBatchCertificate
Azure Batch Cmdlets