Quickstart: Create your API center - Azure CLI
Create your API center to start an inventory of your organization's APIs. Azure API Center enables tracking APIs in a centralized location for discovery, reuse, and governance.
After creating your API center, follow the steps in the tutorials to add custom metadata, APIs, versions, definitions, and other information.
Prerequisites
If you don't have an Azure subscription, create an Azure free account before you begin.
At least a Contributor role assignment or equivalent permissions in the Azure subscription.
For Azure CLI:
Use the Bash environment in Azure Cloud Shell. For more information, see Quickstart for Bash in Azure Cloud Shell.
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
Note
az apic
commands require theapic-extension
Azure CLI extension. If you haven't usedaz apic
commands, the extension can be installed dynamically when you run your firstaz apic
command, or you can install the extension manually. Learn more about Azure CLI extensions.See the release notes for the latest changes and updates in the
apic-extension
.
Register the Microsoft.ApiCenter provider
If you haven't already, you need to register the Microsoft.ApiCenter resource provider in your subscription. You only need to register the resource provider once.
To register the resource provider in your subscription using the Azure CLI, run the following az provider register
command:
az provider register --namespace Microsoft.ApiCenter
You can check the registration status by running the following az provider show
command:
az provider show --namespace Microsoft.ApiCenter
Create a resource group
Azure API Center instances, like all Azure resources, must be deployed into a resource group. Resource groups let you organize and manage related Azure resources.
Create a resource group using the az group create
command. The following example creates a group called MyGroup in the East US location:
az group create --name MyGroup --location eastus
Create an API center
Create an API center using the az apic create
command.
The following example creates an API center called MyApiCenter in the MyGroup resource group. In this example, the API center is deployed in the West Europe location. Substitute an API center name of your choice and enter one of the available locations for your API center.
az apic create --name MyApiCenter --resource-group MyGroup --location westeurope
Output from the command looks similar to the following. By default, the API center is created in the Free plan.
{
"dataApiHostname": "myapicenter.data.westeurope.azure-apicenter.ms",
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/mygroup/providers/Microsoft.ApiCenter/services/myapicenter",
"location": "westeurope",
"name": "myapicenter",
"resourceGroup": "mygroup",
"sku": {
"name": "Free"
},
"systemData": {
"createdAt": "2024-06-22T21:40:35.2541624Z",
"lastModifiedAt": "2024-06-22T21:40:35.2541624Z"
},
"tags": {},
"type": "Microsoft.ApiCenter/services"
}
After deployment, your API center is ready to use!
Next steps
Now you can start adding information to the inventory in your API center. To help you organize your APIs and other information, begin by defining custom metadata in your API center.