创建新的 Azure API 管理服务实例Create a new Azure API Management service instance

Azure API 管理 (APIM) 可帮助组织将 API 发布给外部、合作伙伴和内部开发人员,以充分发挥其数据和服务的潜力。Azure API Management (APIM) helps organizations publish APIs to external, partner, and internal developers to unlock the potential of their data and services. API 管理通过开发人员参与、商业洞察力、分析、安全性和保护提供了核心竞争力以确保成功的 API 程序。API Management provides the core competencies to ensure a successful API program through developer engagement, business insights, analytics, security, and protection. 使用 APIM 可以为在任何位置托管的现有后端服务创建和管理新式 API 网关。APIM enables you to create and manage modern API gateways for existing backend services hosted anywhere. 有关详细信息,请参阅概述主题。For more information, see the Overview topic.

本快速入门介绍使用 PowerShell 脚本创建新的 API 管理实例的步骤。This quickstart describes the steps for creating a new API Management instance using the PowerShell scripts.

如果没有 Azure 订阅,可在开始前创建一个试用帐户If you don't have an Azure subscription, create a trial account before you begin.

Note

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

登录 AzureLog in to Azure

https://portal.azure.cn 登录 Azure 门户。Log in to the Azure portal at https://portal.azure.cn.

如果选择在本地安装并使用 PowerShell,则本教程需要 Azure PowerShell 模块 1.0 或更高版本。If you choose to install and use the PowerShell locally, this tutorial requires the Azure PowerShell module version 1.0 or later. 运行 Get-Module -ListAvailable Az 即可查找版本。Run Get-Module -ListAvailable Az to find the version. 如果需要升级,请参阅安装 Azure PowerShell 模块If you need to upgrade, see Install Azure PowerShell module. 如果在本地运行 PowerShell,则还需运行 Connect-AzAccount 以创建与 Azure 的连接。If you are running PowerShell locally, you also need to run Connect-AzAccount to create a connection with Azure.

创建资源组Create resource group

使用 New-AzResourceGroup 创建 Azure 资源组。Create an Azure resource group with New-AzResourceGroup. 资源组是在其中部署和管理 Azure 资源的逻辑容器。A resource group is a logical container into which Azure resources are deployed and managed.

New-AzureRmResourceGroup -Name myResourceGroup -Location ChinaEast

创建 API 管理服务Create an API Management service

这是一个长时间运行的操作,可能需要长达 15 分钟。This is a long running operation and could take up to 15 minutes.

New-AzApiManagement -ResourceGroupName "myResourceGroup" -Location "China East" -Name "apim-name" -Organization "myOrganization" -AdminEmail "myEmail" -Sku "Developer"

清理资源Clean up resources

如果不再需要资源组和所有相关资源,可以使用 Remove-AzResourceGroup 命令将其删除。When no longer needed, you can use the Remove-AzResourceGroup command to remove the resource group and all related resources.

Remove-AzResourceGroup -Name myResourceGroup

后续步骤Next steps