Edit

Share via


New-AzApiManagementCustomHostnameConfiguration

Creates an instance of PsApiManagementCustomHostNameConfiguration.

Syntax

NoChangeCertificate (Default)

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

SslCertificateFromFile

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

SslCertificateFromKeyVault

New-AzApiManagementCustomHostnameConfiguration
    -Hostname <String>
    -HostnameType <PsApiManagementHostnameType>
    -KeyVaultId <String>
    [-IdentityClientId <String>]
    [-DefaultSslBinding]
    [-NegotiateClientCertificate]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SslCertificateManaged

New-AzApiManagementCustomHostnameConfiguration
    -Hostname <String>
    -HostnameType <PsApiManagementHostnameType>
    [-DefaultSslBinding]
    [-NegotiateClientCertificate]
    [-ManagedCertificate]
    [-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

$portal = New-AzApiManagementCustomHostnameConfiguration -Hostname "portal.contoso.com" -HostnameType Portal -PfxPath "C:\contoso\certificates\apimanagement.pfx" -PfxPassword "1111" -DefaultSslBinding
$customConfig = @($portal)
New-AzApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail [email protected] -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

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

$customConfig = @($portal)
New-AzApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail [email protected] -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.

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

-DefaultSslBinding

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

Parameter properties

Type:SwitchParameter
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

-Hostname

Custom Hostname

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HostNameCertificateInformation

Existing Certificate Configuration.

Parameter properties

Type:PsApiManagementCertificateInformation
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NoChangeCertificate
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-HostnameType

Hostname Type

Parameter properties

Type:PsApiManagementHostnameType
Default value:None
Accepted values:Proxy, Portal, Management, Scm, DeveloperPortal, Configuration, Data
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IdentityClientId

User-Assigned Managed Identity ClientId used to authenticate to KeyVault to fetch Custom SSL Certificate.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SslCertificateFromKeyVault
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KeyVaultId

KeyVaultId to the secret storing the Custom SSL Certificate.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SslCertificateFromKeyVault
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ManagedCertificate

Determines whether we want to provision a managed certificate whose rotation is managed by the platform

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SslCertificateManaged
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NegotiateClientCertificate

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

Parameter properties

Type:SwitchParameter
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

-PfxPassword

Password for the .pfx certificate file.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SslCertificateFromFile
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PfxPath

Path to a .pfx certificate file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SslCertificateFromFile
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
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.

Inputs

PsApiManagementCertificateInformation

Outputs

PsApiManagementCustomHostNameConfiguration