title | description | author | ms.service | ms.topic | ms.custom | ms.date | ms.author | ms.devlang |
---|---|---|---|---|---|---|---|---|
Quickstart - Create Azure API Management instance using CLI |
Create a new Azure API Management service instance by using the Azure CLI. |
dlepow |
api-management |
quickstart |
mode-api, devx-track-azurecli, devdivchpfy22 |
03/29/2022 |
danlep |
azurecli |
Azure API Management (APIM) helps organizations publish APIs to external, partner, and internal developers to unlock the potential of their data and services. API Management provides the core competencies to ensure a successful API program through developer engagement, business insights, analytics, security, and protection. APIM lets you create and manage modern API gateways for existing backend services hosted anywhere. For more information about APIM, see the Overview.
This quickstart describes the steps for creating a new API Management instance using az apim commands in the Azure CLI.
[!INCLUDE quickstarts-free-trial-note]
[!INCLUDE azure-cli-prepare-your-environment.md]
- This article requires version 2.11.1 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
Azure API Management instances, like all Azure resources, must be deployed into a resource group. Resource groups let you organize and manage related Azure resources.
First, create a resource group named myResourceGroup in the Central US location with the following az group create command:
az group create --name myResourceGroup --location centralus
Now that you have a resource group, you can create an API Management service instance. Create one by using the az apim create command and provide a service name and publisher details. The service name must be unique within Azure.
In the following example, myapim is used for the service name. Update the name to a unique value. Also update the name of the API publisher's organization and the email address to receive notifications.
az apim create --name myapim --resource-group myResourceGroup \
--publisher-name Contoso --publisher-email admin@contoso.com \
--no-wait
By default, the command creates the instance in the Developer tier, an economical option to evaluate Azure API Management. This tier isn't for production use. For more information about scaling the API Management tiers, see upgrade and scale.
Tip
It can take between 30 and 40 minutes to create and activate an API Management service in this tier. The previous command uses the --no-wait
option so that the command returns immediately while the service is created.
Check the status of the deployment by running the az apim show command:
az apim show --name myapim --resource-group myResourceGroup --output table
Initially, output is similar to the following, showing the Activating
status:
NAME RESOURCE GROUP LOCATION GATEWAY ADDR PUBLIC IP PRIVATE IP STATUS TIER UNITS
----------- ---------------- ---------- -------------- ----------- ------------ ---------- --------- -------
myapim myResourceGroup Central US Activating Developer 1
After activation, the status is Online
and the service instance has a gateway address and public IP address. For now, these addresses don't expose any content. For example:
NAME RESOURCE GROUP LOCATION GATEWAY ADDR PUBLIC IP PRIVATE IP STATUS TIER UNITS
----------- ---------------- ---------- --------------------------------- ------------ ------------ -------- --------- -------
myapim myResourceGroup Central US https://myapim.azure-api.net 203.0.113.1 Online Developer 1
When your API Management service instance is online, you're ready to use it. Start with the tutorial to import and publish your first API.
You can use the az group delete command to remove the resource group and the API Management service instance when they aren't needed.
az group delete --name myResourceGroup
[!div class="nextstepaction"] Import and publish your first API