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>
[-IdentityClientId <String>]
[-DefaultSslBinding]
[-NegotiateClientCertificate]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
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 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
$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 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: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Hostname
Custom Hostname
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-HostNameCertificateInformation
Existing Certificate Configuration.
Type: | PsApiManagementCertificateInformation |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-HostnameType
Hostname Type
Type: | PsApiManagementHostnameType |
Accepted values: | Proxy, Portal, Management, Scm, DeveloperPortal, Configuration, Data |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IdentityClientId
User-Assigned Managed Identity ClientId used to authenticate to KeyVault to fetch Custom SSL Certificate.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ManagedCertificate
Determines whether we want to provision a managed certificate whose rotation is managed by the platform
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PfxPassword
Password for the .pfx certificate file.
Type: | SecureString |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PfxPath
Path to a .pfx certificate file.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
PsApiManagementCertificateInformation
Outputs
PsApiManagementCustomHostNameConfiguration