Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API Center] azure-api-center-create #13985

Merged
merged 9 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 42 additions & 0 deletions quickstarts/microsoft.apicenter/azure-api-center-create/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
description: This template creates an instance of Azure API Center and registers a sample API.
page_type: sample
products:
- azure
- azure-resource-manager
- azure-api-center
urlFragment: azure-api-center-create
languages:
- bicep
- json
---
# Create an Azure API Center instance using a template

![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/PublicLastTestDate.svg)
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/PublicDeployment.svg)

![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/FairfaxLastTestDate.svg)
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/FairfaxDeployment.svg)

![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/BestPracticeResult.svg)
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/CredScanResult.svg)

![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.apicenter/azure-api-center-create/BicepVersion.svg)

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.apicenter%2Fazure-api-center-create%2Fazuredeploy.json)
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.apicenter%2Fazure-api-center-create%2Fazuredeploy.json)
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.apicenter%2Fazure-api-center-create%2Fazuredeploy.json)

This template deploys an API center and registers a sample API in the API center. For deployment, use a resource group located in one of the [supported regions](https://learn.microsoft.com/azure/api-center/overview#available-regions) for Azure API Center.

## Parameters

| Name | Type | Required | Description |
| :------------- | :----------: | :----------: | :------------- |
| location | string | Yes | Specifies the location for the API center. |
| apiCenterName | string | Yes | Specifies the name of the API center. |
| apiName | string | No | Specifies the name of an API to register in the API center. |
| apiType | string | No | Specifies the type of API to register in the API center. Example *REST*. |


`Tags: Microsoft.ApiCenter/service`
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"apiName": {
"value": "first-api"
},
"apiType": {
"value": "rest"
}
}
}
43 changes: 43 additions & 0 deletions quickstarts/microsoft.apicenter/azure-api-center-create/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@description('Specifies the location for resources.')
param location string = resourceGroup().location
@description('The name of the API center.')
param apiCenterName string = 'apicenter${uniqueString(resourceGroup().id)}'
@description('The name of an API to register in the API center.')
param apiName string = 'first-api'
@description('The type of the API to register in the API center.')
@allowed([
'rest'
'soap'
'graphql'
'grpc'
'webhook'
'websocket'
])
param apiType string = 'rest'

resource apiCenterService 'Microsoft.ApiCenter/services@2024-03-01' = {
name: apiCenterName
location: location
properties: {}
}

resource apiCenterWorkspace 'Microsoft.ApiCenter/services/workspaces@2024-03-01' = {
parent: apiCenterService
name: 'default'
properties: {
title: 'Default workspace'
description: 'Default workspace'
}
}

resource apiCenterAPI 'Microsoft.ApiCenter/services/workspaces/apis@2024-03-01' = {
parent: apiCenterWorkspace
name: apiName
properties: {
title: apiName
kind: apiType
externalDocumentation: []
contacts: []
customProperties: {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Create an Azure API Center instance using a template",
"description": "This template creates an API center and registers an API in the API center.",
"summary": "Create an Azure API Center instance using a template",
"githubUsername": "dlepow",
"docOwner": "dlepow",
"dateUpdated": "2024-04-17"
}