Skip to content

Commit 9828618

Browse files
committed
updates1
1 parent 3fd5796 commit 9828618

File tree

1 file changed

+104
-7
lines changed

1 file changed

+104
-7
lines changed

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

Lines changed: 104 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/09/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,100 @@ 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+
# Quickstart: Use Terraform to configure Azure API Management
216+
217+
In this quickstart, 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. Azure API Management is a fully managed service that helps developers publish, secure, transform, maintain, and monitor APIs. It provides a unified management experience and full observability across all internal and external APIs. The service is scalable and helps protect your APIs from unauthorized access with keys, tokens, IP filtering, and more. It's used to connect applications and services through APIs, allowing different software systems to communicate with each other.
218+
219+
[!INCLUDE [About Terraform](~/azure-dev-docs-pr/articles/terraform/includes/abstract.md)]
220+
221+
> [!div class="checklist"]
222+
> * Generate a random name for the resource group.
223+
> * Create a resource group in a specified location with the generated name.
224+
> * Generate a random name for the API Management service.
225+
> * Create an API Management service with the generated name, in the created resource group.
226+
> * Generate a random name for the API.
227+
> * Generate a random content value.
228+
> * Create an API with the generated name and content value, in the created resource group and API Management service.
229+
> * Generate a random name for the product.
230+
> * Create a product with the generated name, in the created resource group and API Management service.
231+
> * Generate a random name for the group.
232+
> * Create a group with the generated name, in the created resource group and API Management service.
233+
> * Associate the created API with the created product.
234+
> * Associate the created group with the created product.
235+
> * Output the names of the created resource group, API Management service, API, product, and group.
236+
> * Output the ID, gateway URL, and public IP addresses of the created API Management service.
237+
> * Output the IDs, state, and version outputs of the created APIs.
238+
> * Output the ID of the created product.
239+
> * Output the ID of the association between the created product and API.
240+
> * Output the ID of the association between the created product and group.
241+
> * Specify the required version of Terraform and the required providers.
242+
> * Define variables for the resource group name prefix, resource group location, and the content format and value for the API definition import.
243+
244+
## Prerequisites
245+
246+
- Create an Azure account with an active subscription. You can [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
247+
248+
- [Install and configure Terraform.](/azure/developer/terraform/quickstart-configure)
249+
250+
## Implement the Terraform code
251+
252+
> [!NOTE]
253+
> 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).
254+
>
255+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform).
256+
257+
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
258+
259+
1. Create a file named `main.tf` and insert the following code:
260+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/main.tf":::
261+
262+
1. Create a file named `outputs.tf` and insert the following code:
263+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/outputs.tf":::
264+
265+
1. Create a file named `providers.tf` and insert the following code:
266+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/providers.tf":::
267+
268+
1. Create a file named `variables.tf` and insert the following code:
269+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-api-management-create-with-api/variables.tf":::
270+
271+
## Initialize Terraform
272+
273+
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
274+
275+
## Create a Terraform execution plan
276+
277+
[!INCLUDE [terraform-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan.md)]
278+
279+
## Apply a Terraform execution plan
280+
281+
[!INCLUDE [terraform-apply-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-apply-plan.md)]
282+
283+
## Verify the results
284+
285+
### [Azure CLI](#tab/azure-cli)
286+
287+
Run [`az apim show`](/cli/azure/apim#az-apim-show) to view the Azure API Management.
288+
289+
The placeholders in the code block that must be changed are `<resource_group_name_prefix>`, `<resource_group_location>`, `<open_api_spec_content_format>`, and `<open_api_spec_content_value>`.
290+
291+
---
292+
293+
## Clean up resources
294+
295+
[!INCLUDE [terraform-plan-destroy.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan-destroy.md)]
296+
297+
## Troubleshoot Terraform on Azure
298+
299+
[Troubleshoot common problems when using Terraform on Azure](/azure/developer/terraform/troubleshoot).
300+
301+
## Next steps
302+
303+
> [!div class="nextstepaction"]
304+
> [See more articles about Azure API Management](/search/?terms=Azure%20api%20management%20and%20terraform).
305+
306+
:::zone-end

0 commit comments

Comments
 (0)