New-AzureRmApiManagement

Creates an API Management deployment.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmApiManagement
   -ResourceGroupName <String>
   -Name <String>
   -Location <String>
   -Organization <String>
   -AdminEmail <String>
   [-Sku <PsApiManagementSku>]
   [-Capacity <Int32>]
   [-VpnType <PsApiManagementVpnType>]
   [-VirtualNetwork <PsApiManagementVirtualNetwork>]
   [-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
   [-AdditionalRegions <PsApiManagementRegion[]>]
   [-CustomHostnameConfiguration <PsApiManagementCustomHostNameConfiguration[]>]
   [-SystemCertificateConfiguration <PsApiManagementSystemCertificate[]>]
   [-AssignIdentity]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmApiManagement cmdlet creates an API Management deployment in Azure API Management.

Examples

Example 1: Create a Developer tier API Management service

PS C:\>New-AzureRmApiManagement -ResourceGroupName "ContosoGroup02" -Name "ContosoApi" -Location "Central US" -Organization "Contoso" -AdminEmail "admin@contoso.com"

This command creates a Developer tier API Management service. The command specifies the organization and the administrator address. The command does not specify the SKU parameter. Therefore, the cmdlet uses the default value of Developer.

Example 2: Create a Standard tier service that has three units

PS C:\>New-AzureRmApiManagement -ResourceGroupName "ContosoGroup02 -Name "ContosoApi" -Location "Central US" -Organization "Contoso" -AdminEmail "admin@contoso.com" -Sku Standard -Capacity 3

This command creates a Standard tier API Management service that has three units.

Example 3: Create an API Management service for an external virtual network

PS C:\> $virtualNetwork = New-AzureRmApiManagementVirtualNetwork -Location "West US" -SubnetResourceId "/subscriptions/a8ff56dc-3bc7-4174-b1e8-3726ab15d0e2/resourceGroups/ContosoGroup/providers/Microsoft.Network/virtualNetworks/westUsVirtualNetwork/subnets/backendSubnet"
PS C:\> New-AzureRmApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization Contoso -AdminEmail admin@contoso.com -VirtualNetwork $virtualNetwork -VpnType "External" -Sku "Premium"

This command creates a Premium-tier API Management service in an Azure virtual network subnet having an external-facing gateway endpoint with a master region in the West US.

Example 4: Create an API Management service for an internal virtual network

PS C:\> $virtualNetwork = New-AzureRmApiManagementVirtualNetwork -Location "West US" -SubnetResourceId "/subscriptions/a8ff56dc-3bc7-4174-b1e8-3726ab15d0e2/resourceGroups/ContosoGroup/providers/Microsoft.Network/virtualNetworks/westUsVirtualNetwork/subnets/backendSubnet"
PS C:\> New-AzureRmApiManagement -ResourceGroupName "ContosoGroup" -Location "West US" -Name "ContosoApi" -Organization "Contoso" -AdminEmail "admin@contoso.com" -VirtualNetwork $virtualNetwork -VpnType "Internal" -Sku "Premium"

This command creates a Premium-tier API Management service in an Azure virtual network subnet having an internal-facing gateway endpoint with a master region in the West US.

Parameters

-AdditionalRegions

Additional deployment regions of Azure API Management.

Type:PsApiManagementRegion[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-AdminEmail

Specifies the originating email address for all notifications that the API Management system sends.

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

-AssignIdentity

Generate and assign a Microsoft Entra identity for this server for use with key management services like Azure KeyVault.

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

-Capacity

Specifies the SKU capacity of the Azure API Management service. The default is one (1).

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-CustomHostnameConfiguration

Custom hostname configurations. Default value is $null. Passing $null will set the default hostname.

Type:PsApiManagementCustomHostNameConfiguration[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Specifies the location to create the Api Management service. To obtain valid locations, use the cmdlet Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where {$_.ResourceTypes[0].ResourceTypeName -eq "service"} | Select-Object Locations

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

-Name

Specifies a name for the API Management deployment.

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

-Organization

Specifies the name of an organization. API Management uses this address in the developer portal in email notifications.

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

-ResourceGroupName

Specifies the name of the of resource group under which this cmdlet creates an API Management deployment.

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

-Sku

Specifies the tier of the API Management service. Valid values are:

  • Developer
  • Standard
  • Premium The default is Developer.
Type:Nullable<T>[PsApiManagementSku]
Accepted values:Developer, Basic, Standard, Premium
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SystemCertificateConfiguration

Certificates issued by Internal CA to be installed on the service. Default value is $null.

Type:PsApiManagementSystemCertificate[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Tags dictionary.

Type:Dictionary<TKey,TValue>[System.String,System.String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VirtualNetwork

Virtual Network Configuration of master Azure API Management deployment region.

Type:PsApiManagementVirtualNetwork
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VpnType

Virtual Network Type of the ApiManagement Deployment. Valid Values are

  • "None" (Default Value. ApiManagement is not part of any Virtual Network")
  • "External" (ApiManagement Deployment is setup inside a Virtual Network having an Internet Facing Endpoint)
  • "Internal" (ApiManagement Deployment is setup inside a Virtual Network having an Intranet Facing Endpoint)
Type:PsApiManagementVpnType
Accepted values:None, External, Internal
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Nullable<T>[[Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagementSku, Microsoft.Azure.Commands.ApiManagement, Version=6.1.2.0, Culture=neutral, PublicKeyToken=null]]

Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

PsApiManagementVirtualNetwork

Dictionary<TKey,TValue>[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

PsApiManagementRegion[]

PsApiManagementCustomHostNameConfiguration[]

PsApiManagementSystemCertificate[]

Outputs

PsApiManagement