title | description | services | author | ms.service | tags | ms.custom | ms.topic | ms.author | ms.date |
---|---|---|---|---|---|---|---|---|---|
Quickstart - Create Azure API Management instance - Bicep |
Use this quickstart to create an Azure API Management instance in the Developer tier by using Bicep. |
azure-resource-manager |
mumian |
api-management |
azure-resource-manager, bicep |
devx-track-bicep, subject-bicepqs, devx-track-azurecli, devx-track-azurepowershell |
quickstart-bicep |
jgao |
03/25/2024 |
[!INCLUDE api-management-availability-all-tiers]
This quickstart describes how to use a Bicep file to create an Azure API Management instance. You can also use Bicep for common management tasks such as importing APIs in your API Management instance.
[!INCLUDE api-management-quickstart-intro]
[!INCLUDE About Bicep]
-
If you don't have an Azure subscription, create a free account before you begin.
-
For Azure CLI:
-
For Azure PowerShell:
[!INCLUDE azure-powershell-requirements-no-header]
The Bicep file used in this quickstart is from Azure Quickstart Templates.
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.apimanagement/azure-api-management-create/main.bicep":::
The following resource is defined in the Bicep file:
In this example, the Bicep file by default configures the API Management instance in the Developer tier, an economical option to evaluate Azure API Management. This tier isn't for production use.
More Azure API Management Bicep samples can be found in Azure Quickstart Templates.
You can use Azure CLI or Azure PowerShell to deploy the Bicep file. For more information about deploying Bicep files, see Deploy.
-
Save the Bicep file as main.bicep to your local computer.
-
Deploy the Bicep file using either Azure CLI or Azure PowerShell.
az group create --name exampleRG --location eastus az deployment group create --resource-group exampleRG --template-file main.bicep --parameters publisherEmail=<publisher-email> publisherName=<publisher-name>
New-AzResourceGroup -Name exampleRG -Location eastus New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -publisherEmail "<publisher-email>" -publisherName "<publisher-name>"
Replace <publisher-name> and <publisher-email> with the name of the API publisher's organization and the email address to receive notifications.
When the deployment finishes, you should see a message indicating the deployment succeeded.
[!TIP] It can take between 30 and 40 minutes to create and activate an API Management service in the Developer tier. Times vary by tier.
Use the Azure portal, Azure CLI or Azure PowerShell to list the deployed App Configuration resource in the resource group.
az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG
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.
If you plan to continue working with subsequent tutorials, you might want to leave the API Management instance in place. When no longer needed, delete the resource group, which deletes the resources in the resource group.
az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG
[!div class="nextstepaction"] Tutorial: Import and publish your first API