是的,可以使用 Azure Powershell 1.0 commandlet https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/以编程方式创建 ApiManagement 服务。下面是可帮助您实现它的命令行开关。
PS C:\WINDOWS\system32> get-help New-AzureRmApiManagement -example
NAME
New-AzureRmApiManagement
SYNOPSIS
Creates an API Management deployment.
SYNTAX
New-AzureRmApiManagement [-Capacity [<Int32>]] [-Sku [<PsApiManagementSku>]] [-Tags [<0, Culture=neutral,
PublicKeyToken=b77a5c561934e089>]] -AdminEmail <String> -Location {North Central US | South Central US | Central
US | West Europe | North Europe | West US | East US | East US 2 | Japan East | Japan West | Brazil South |
Southeast Asia | East Asia | Australia East | Australia Southeast} -Name <String> -Organization <String>
-ResourceGroupName <String> [<CommonParameters>]
Example 1: Create at 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.
您可以使用以下命令找到其他命令行开关
get-Help AzureRmApiManagement
可以在此处找到命令行开关的完整文档
https://msdn.microsoft.com/en-us/library/mt619282.aspx