title | description | author | ms.service | ms.custom | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Quickstart - Create your Azure API center - Bicep | In this quickstart, use Bicep to set up an API center for API discovery, reuse, and governance. | dlepow | azure-api-center | devx-track-azurepowershell, devx-track-bicep | quickstart | 05/13/2024 | danlep |
[!INCLUDE quickstart-intro]
[!INCLUDE resource-manager-quickstart-bicep-introduction]
[!INCLUDE quickstart-prerequisites]
For Azure CLI: [!INCLUDE include]
For Azure PowerShell: [!INCLUDE azure-powershell-requirements-no-header.md]
The Bicep file used in this quickstart is from Azure Quickstart Templates.
In this example, the Bicep file creates an API center in the Free plan and registers a sample API in the default workspace. Currently, API Center supports a single, default workspace for all child resources.
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.apicenter/azure-api-center-create/main.bicep":::
The following Azure resources are defined in the Bicep file:
- Microsoft.ApiCenter/services
- Microsoft.ApiCenter/services/workspaces
- Microsoft.ApiCenter/services/workspaces/apis
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.
# Create a resource group in one of the supported regions for Azure API Center az group create --name exampleRG --location eastus az deployment group create --resource-group exampleRG --template-file main.bicep --parameters apiName="<api-name>" apiType="<api-type>"
# Create a resource group in one of the supported regions for Azure API Center New-AzResourceGroup -Name exampleRG -Location eastus New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -apiName "<api-name>" -apiType "<api-type>"
Replace <api-name> and <api-type> with the name and type of an API that you want to register in your API center.
When the deployment finishes, you should see a message indicating the deployment succeeded.
[!INCLUDE quickstart-template-review-resources]
[!INCLUDE quickstart-next-steps]