Set-​Azure​Rm​Api​Management​Hostnames

Sets a custom hostname configuration for an API Management service proxy or portal.

Syntax

Set-AzureRmApiManagementHostnames
   -ResourceGroupName <String>
   -Name <String>
   [-PortalHostnameConfiguration <PsApiManagementHostnameConfiguration>]
   [-ProxyHostnameConfiguration <PsApiManagementHostnameConfiguration>]
   [-PassThru]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureRmApiManagementHostnames
   [-PassThru]
   -ApiManagement <PsApiManagement>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The Set-AzureRmApiManagementHostnames cmdlet applies a custom hostname configuration for an API Management service proxy or portal.

Examples

Example 1: Set the custom hostname configuration for a proxy and portal

PS C:\>Set-AzureRmApiManagementHostnames -Name ContosoApi -ResourceGroupName Contoso -PortalHostnameConfiguration $portalHostnameConf -ProxyHostnameConfiguration $proxyHostnameConf

This command sets the custom hostname configuration for proxy and portal.

Example 2: Configure a custom hostname for a proxy and portal

PS C:\>Import-AzureRmApiManagementHostnameCertificate -Name ContosoApi -ResourceGroupName "Contoso" -HostnameType "Proxy" -PfxPath "C:\proxycert.pfx" -PfxPassword "CertSecret"
PS C:\> Import-AzureRmApiManagementHostnameCertificate -Name "ContosoApi" -ResourceGroupName "Contoso" -HostnameType "Portal" -PfxPath "C:\portalcert.pfx" -PfxPassword "CertSecret"
PS C:\> $PortalHostnameConf = New-AzureRmApiManagementHostnameConfiguration -Hostname "portal.contoso.com" -CertificateThumbprint "33CC47C6FCA848DC9B14A6F071C1EF7C"
PS C:\> $ProxyHostnameConf = New-AzureRmApiManagementHostnameConfiguration -Hostname "proxy.contoso.com" -CertificateThumbprint "5DD7CCF6A1E74E0987DD2873406B7264"
PS C:\> Set-AzureRmApiManagementHostnames -Name "ContosoApi" -ResourceGroupName "Contoso" -PortalHostnameConfiguration $PortalHostnameConf -ProxyHostnameConfiguration $ProxyHostnameConf

This example configures a custom hostname for proxy and portal. You need to import corresponding certificates and then apply the custom hostnames.

Required Parameters

-ApiManagement

Specifies the PsApiManagement instance that this cmdlet gets the PortalHostnameConfiguration and ProxyHostnameConfiguration parameters from.

Type:PsApiManagement
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the API Management instance.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:False
Accept wildcard characters:False
-PortalHostnameConfiguration

Specifies the custom portal hostname configuration. Passing $null to the cmdlet sets the default hostname.

Type:PsApiManagementHostnameConfiguration
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ProxyHostnameConfiguration

Specifies the custom proxy hostname configuration. Passing $null sets the default hostname.

Type:PsApiManagementHostnameConfiguration
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False