次の方法で共有


New-AzureRmApiManagementCustomHostnameConfiguration

PsApiManagementCustomHostNameConfiguration のインスタンスを作成します。

警告

AzureRM PowerShell モジュールは、2024 年 2 月 29 日の時点で正式に非推奨になりました。 引き続きサポートを受け、更新を受け取れるようにするために、AzureRM から Az PowerShell モジュールに移行することをお勧めします。

AzureRM モジュールは引き続き機能する可能性がありますが、メインが維持またはサポートされなくなり、ユーザーの判断とリスクで引き続き使用できます。 Az モジュールへの移行に関するガイダンスについては、移行リソースを参照してください。

構文

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

説明

New-AzureRmApiManagementCustomHostnameConfiguration コマンドレットは、PsApiManagementCustomHostNameConfigurationインスタンスを作成するヘルパー コマンドです。 このコマンドは、New-AzureRmApiManagement コマンドレットと Set-AzureRmApiManagement コマンドレットで使用されます。

例 1: ファイルの Ssl 証明書を使用して PsApiManagementCustomHostNameConfiguration のインスタンスを作成して初期化する

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

このコマンドは、ポータル用 PsApiManagementCustomHostNameConfiguration のインスタンスを作成して初期化します。 次に、カスタム ホスト名構成を使用して新しい ApiManagement サービスを作成します。

例 2: KeyVault リソースのシークレットを使用して PsApiManagementCustomHostNameConfiguration のインスタンスを作成して初期化する

PS C:\>$portal = New-AzureRmApiManagementCustomHostnameConfiguration -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-AzureRmApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail admin@contoso.com -CustomHostnameConfiguration $customConfig -AssignIdentity

このコマンドは、PsApiManagementCustomHostNameConfiguration の インスタンスを作成して初期化します

パラメーター

-DefaultProfile

Azure との通信のために使用される資格情報、アカウント、テナント、サブスクリプションです。

型:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultSslBinding

値がシークレットかどうかと暗号化する必要があるかどうかを決定します。 このパラメーターは省略可能です。 既定値は false です。

型:SwitchParameter
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-Hostname

カスタム ホスト名

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

-HostNameCertificateInformation

既存の証明書の構成。

型:PsApiManagementCertificateInformation
Position:Named
既定値:None
必須:True
Accept pipeline input:True
Accept wildcard characters:False

-HostnameType

ホスト名の種類

型:PsApiManagementHostnameType
承認された値:Proxy, Portal, Management, Scm
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

-KeyVaultId

カスタム SSL 証明書を格納するシークレットへの KeyVaultId。

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

-NegotiateClientCertificate

値がシークレットかどうかと暗号化する必要があるかどうかを決定します。 このパラメーターは省略可能です。 既定値は false です。

型:SwitchParameter
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-PfxPassword

.pfx 証明書ファイルのパスワード。

型:SecureString
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-PfxPath

.pfx 証明書ファイルへのパス。

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

入力

PsApiManagementCertificateInformation

出力

PsApiManagementCustomHostNameConfiguration