Import-AzureRmApiManagementHostnameCertificate

Imports a certificate in a PFX format for an API Management Service.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Import-AzureRmApiManagementHostnameCertificate
      -ResourceGroupName <String>
      -Name <String>
      -HostnameType <PsApiManagementHostnameType>
      -PfxPath <String>
      -PfxPassword <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]

Description

The Import-AzureRmApiManagementHostnameCertificate cmdlet imports a certificate in a PFX format for an API Management Service. The certificate is to be used for custom hostnames configuration.

Examples

Example 1: Import a API Management hostname certificate

PS C:\>Import-AzureRmApiManagementHostnameCertificate -Name "ContosoApi" -ResourceGroupName Contoso -HostnameType "Proxy" -PfxPath "C:\proxycert.pfx" -PfxPassword "CertSecret"

This command imports a certificate for a proxy custom hostname.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HostnameType

Specifies the host name type that this cmdlet loads the certificate for. Valid values are:

  • Proxy
  • Portal
Type:PsApiManagementHostnameType
Accepted values:Proxy, Portal, Management, Scm
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the API Management deployment that this cmdlet imports.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PfxPassword

Specifies the password for the .pfx certificate file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PfxPath

Specifies the path to a .pfx certificate file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of the of resource group under which the API Management deployment exists.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

PsApiManagementHostnameType

Outputs

PsApiManagementHostnameCertificate