New-AzApiManagementCustomHostnameConfiguration

Creates an instance of PsApiManagementCustomHostNameConfiguration.

Syntax

New-AzApiManagementCustomHostnameConfiguration
   -Hostname <String>
   -HostnameType <PsApiManagementHostnameType>
   -HostNameCertificateInformation <PsApiManagementCertificateInformation>
   [-DefaultSslBinding]
   [-NegotiateClientCertificate]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzApiManagementCustomHostnameConfiguration
   -Hostname <String>
   -HostnameType <PsApiManagementHostnameType>
   -PfxPath <String>
   [-PfxPassword <SecureString>]
   [-DefaultSslBinding]
   [-NegotiateClientCertificate]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzApiManagementCustomHostnameConfiguration
   -Hostname <String>
   -HostnameType <PsApiManagementHostnameType>
   -KeyVaultId <String>
   [-DefaultSslBinding]
   [-NegotiateClientCertificate]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzApiManagementCustomHostnameConfiguration cmdlet is a helper command that creates an instance of PsApiManagementCustomHostNameConfiguration. This command is used with the New-AzApiManagement and Set-AzApiManagement cmdlet.

Examples

Example 1: Create and initialize an instance of PsApiManagementCustomHostNameConfiguration using an Ssl Certificate from file

PS C:\>$portal = New-AzApiManagementCustomHostnameConfiguration -Hostname "portal.contoso.com" -HostnameType Portal -PfxPath "C:\contoso\certificates\apimanagement.pfx" -PfxPassword "1111" -DefaultSslBinding
PS C:\>$customConfig = @($portal)
PS C:\>New-AzApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail admin@contoso.com -CustomHostnameConfiguration $customConfig

This command creates and initializes an instance of PsApiManagementCustomHostNameConfiguration for Portal. Then it creates a new ApiManagement service with custom hostname configuration.

Example 2: Create and initialize an instance of PsApiManagementCustomHostNameConfiguration using an Secret from KeyVault Resource

PS C:\>$portal = New-AzApiManagementCustomHostnameConfiguration -Hostname "portal.contoso.com" -HostnameType Portal -KeyVaultId "https://apim-test-keyvault.vault.azure.net/secrets/api-portal-custom-ssl.pfx"

PS C:\>$customConfig = @($portal)
PS C:\>New-AzApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail admin@contoso.com -CustomHostnameConfiguration $customConfig -SystemAssignedIdentity

This command creates and initializes an instance of PsApiManagementCustomHostNameConfiguration.

Parameters

-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultSslBinding

Determines whether the value is a secret and should be encrypted or not. This parameter is optional. Default Value is false.

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

Custom Hostname

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HostNameCertificateInformation

Existing Certificate Configuration.

Type:Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagementCertificateInformation
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-HostnameType

Hostname Type

Type:Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagementHostnameType
Accepted values:Proxy, Portal, Management, Scm, DeveloperPortal
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-KeyVaultId

KeyVaultId to the secret storing the Custom SSL Certificate.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NegotiateClientCertificate

Determines whether the value is a secret and should be encrypted or not. This parameter is optional. Default Value is false.

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

Password for the .pfx certificate file.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PfxPath

Path to a .pfx certificate file.

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

Inputs

Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagementCertificateInformation

Outputs

PsApiManagementCustomHostNameConfiguration