Azure API Management

Inside scoop from the API Management team

Breaking changes to PowerShell cmdlets

The following cmdlets were affected in the latest release of Azure PowerShell 3.0.0. You can also view these changes on GitHub.

New-AzureRmApiManagementVirtualNetwork

The required parameters to reference a virtual network changed from SubnetName and VnetId to SubnetResourceId in the format of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ClassicNetwork/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}

# Old
$virtualNetwork = New-AzureRmApiManagementVirtualNetwork -Location -SubnetName -VnetId

# New
$virtualNetwork = New-AzureRmApiManagementVirtualNetwork -Location -SubnetResourceId

Deprecating Cmdlet Set-AzureRmApiManagementVirtualNetworks

The cmdlet is deprecated as there is more than one way to set the virtual network associated with an API Management instance.

# Old
$networksList = @()
$networksList += New-AzureRmApiManagementVirtualNetwork -Location $vnetLocation -VnetId $vnetId -SubnetName $subnetName
Set-AzureRmApiManagementVirtualNetworks -ResourceGroupName "ContosoGroup" -Name "ContosoApi" -VirtualNetworks $networksList

# New
$masterRegionVirtualNetwork = New-AzureRmApiManagementVirtualNetwork -Location -SubnetResourceId
Update-AzureRmApiManagementDeployment -ResourceGroupName "ContosoGroup" -Name "ContosoApi" -VirtualNetwork $masterRegionVirtualNetwork