< Back

New-AzureRmApiManagementCertificate

Tue Jan 29, 2019 9:29 pm

NAME New-AzureRmApiManagementCertificate



SYNOPSIS

Creates an API Management certificate to be used during Authentication with Backend.





SYNTAX

New-AzureRmApiManagementCertificate [-CertificateId <String>] -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>]

-PfxBytes <Byte[]> -PfxPassword <String> [<CommonParameters>]



New-AzureRmApiManagementCertificate [-CertificateId <String>] -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>]

-PfxFilePath <String> -PfxPassword <String> [<CommonParameters>]





DESCRIPTION

The New-AzureRmApiManagementCertificate cmdlet creates an Azure API Management certificate.





PARAMETERS

-CertificateId <String>

Specifies the ID of the certificate to create. If you do not specify this parameter, an ID is generated for you.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Context <PsApiManagementContext>

Specifies a PsApiManagementContext object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

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



-PfxBytes <Byte[]>

Specifies an array of bytes of the certificate file in .pfx format. This parameter is required if you do not specify the PfxFilePath parameter.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PfxFilePath <String>

Specifies the path to the certificate file in .pfx format to create and upload. This parameter is required if you do not specify the PfxBytes

parameter.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PfxPassword <String>

Specifies the password for the certificate.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

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

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementCertificate







NOTES









Example 1: Create and upload a certificate



PS C:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"

PS C:\\>New-AzureRmApiManagementCertificate -Context $ApiMgmtContext -PfxFilePath "C:\\contoso\\certificates\\apimanagement.pfx" -PfxPassword "1111"



This command uploads a certificate to Api Management. This certificate can be used for mutual authentication with backend using policies.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ertificate

Get-AzureRmApiManagementCertificate

Remove-AzureRmApiManagementCertificate

Set-AzureRmApiManagementCertificate