Skip to content

Commit 55ff976

Browse files
authored
Merge pull request #288099 from LiSeda/L-api-add-products
LS_api-management-howto-add-products.md
2 parents aeb6c89 + 33769b3 commit 55ff976

File tree

2 files changed

+102
-8
lines changed

2 files changed

+102
-8
lines changed

articles/api-management/api-management-howto-add-products.md

Lines changed: 92 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
22
title: Tutorial - Create and publish a product in Azure API Management
33
description: In this tutorial, you create and publish a product in Azure API Management. Once it's published, developers can begin to use the product's APIs.
4-
5-
author: dlepow
6-
ms.service: azure-api-management
74
ms.topic: tutorial
8-
ms.date: 01/18/2022
9-
ms.author: danlep
5+
ms.date: 10/22/2024
106
ms.custom: devdivchpfy22, devx-track-azurecli
7+
ms.service: azure-api-management
8+
author: dlepow
9+
ms.author: danlep
1110
ms.devlang: azurecli
12-
11+
zone_pivot_groups: api-management-howto-add-products
1312
---
1413
# Tutorial: Create and publish a product
1514

1615
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1716

1817
In Azure API Management, a [*product*](api-management-terminology.md#term-definitions) contains one or more APIs, a usage quota, and the terms of use. After a product is published, developers can [subscribe](api-management-subscriptions.md) to the product and begin to use the product's APIs.
1918

19+
:::zone pivot="interactive"
20+
2021
In this tutorial, you learn how to:
2122

2223
> [!div class="checklist"]
@@ -26,7 +27,6 @@ In this tutorial, you learn how to:
2627
2728
:::image type="content" source="media/api-management-howto-add-products/added-product-1.png" alt-text="API Management products in portal":::
2829

29-
3030
## Prerequisites
3131

3232
+ Learn the [Azure API Management terminology](api-management-terminology.md).
@@ -207,3 +207,88 @@ Advance to the next tutorial:
207207

208208
> [!div class="nextstepaction"]
209209
> [Create blank API and mock API responses](mock-api-responses.md)
210+
211+
:::zone-end
212+
213+
:::zone pivot="terraform"
214+
215+
In this article, you use Terraform to create an Azure API Management instance, an API, a product, a group, and associations between the product and the API, and the product and the group.
216+
217+
[!INCLUDE [About Terraform](~/azure-dev-docs-pr/articles/terraform/includes/abstract.md)]
218+
219+
> [!div class="checklist"]
220+
>
221+
> * Specify the required version of Terraform and the required providers.
222+
> * Define variables for the resource group name prefix, resource group location, and the content format and value for the API definition import.
223+
> * Create a resource group with a randomized name.
224+
> * Create an API Management service with a randomized name.
225+
> * Create an API with a randomized name.
226+
> * Create a product with a randomized name in the API Management service.
227+
> * Create a group with a randomized name.
228+
> * Associate the API with the product.
229+
> * Associate the group with the product.
230+
> * Output the randomized values such as the names of the resource group, API Management service, API, product, and group.
231+
232+
## Prerequisites
233+
234+
- Create an Azure account with an active subscription. You can [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
235+
236+
- [Install and configure Terraform.](/azure/developer/terraform/quickstart-configure)
237+
238+
## Implement the Terraform code
239+
240+
> [!NOTE]
241+
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-api-management-create-with-api). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-api-management-create-with-api/TestRecord.md).
242+
>
243+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform).
244+
245+
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
246+
247+
1. Create a file named `main.tf`, and insert the following code:
248+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/main.tf":::
249+
250+
1. Create a file named `outputs.tf`, and insert the following code:
251+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/outputs.tf":::
252+
253+
1. Create a file named `providers.tf`, and insert the following code:
254+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/providers.tf":::
255+
256+
1. Create a file named `variables.tf`, and insert the following code:
257+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/variables.tf":::
258+
259+
## Initialize Terraform
260+
261+
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
262+
263+
## Create a Terraform execution plan
264+
265+
[!INCLUDE [terraform-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan.md)]
266+
267+
## Apply a Terraform execution plan
268+
269+
[!INCLUDE [terraform-apply-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-apply-plan.md)]
270+
271+
## Verify the results
272+
273+
Run [`az apim show`](/cli/azure/apim#az-apim-show) to view the Azure API Management:
274+
275+
```azurecli
276+
277+
az apim show --<apim_service_name> --<resource_group_name>
278+
279+
```
280+
281+
## Clean up resources
282+
283+
[!INCLUDE [terraform-plan-destroy.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan-destroy.md)]
284+
285+
## Troubleshoot Terraform on Azure
286+
287+
[Troubleshoot common problems when using Terraform on Azure](/azure/developer/terraform/troubleshoot).
288+
289+
## Next steps
290+
291+
> [!div class="nextstepaction"]
292+
> [Create blank API and mock API responses](mock-api-responses.md).
293+
294+
:::zone-end

articles/zone-pivot-groups.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,4 +1693,13 @@ groups:
16931693
- id: experience-azcli
16941694
title: Azure CLI
16951695
- id: experience-gui
1696-
title: Grafana UI
1696+
title: Grafana UI
1697+
# Owner: danlep
1698+
- id: api-management-howto-add-products
1699+
title: Interactive or Script
1700+
prompt: Choose Interactive for Azure CLI and Azure Portal instructions, or Terraform
1701+
pivots:
1702+
- id: interactive
1703+
title: Interactive
1704+
- id: terraform
1705+
title: Terraform

0 commit comments

Comments
 (0)