Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 4.3 KB

3 - Products.md

File metadata and controls

61 lines (43 loc) · 4.3 KB

Exercise 3: Azure API Management Products

In the last exercise, we imported our serverless APIs into our API Management service. In this exercise, we will look at the API Management product concept.

Product details

What is an API Management product and why use it?

An API Management Product is a way to organize and manage one or more APIs. You can include a number of APIs and offer them to developers (consumers of your APIs).

The benefits of using products include:

  • Ability to package one or more APIs to your developers (consumers)
  • Ability to create both products requiring subscriptions (Protected) and products which do not (Open)
  • Ability to publish/unpublish products for general availability
  • Ability to apply policy (such as usage quota), specify whether approval is required, legal terms at a product level when bundling APIs for business reasons
  • Ability to control visibility and access to products within the API Management Developer Portal by associating to groups (applies only to dedicated API Management tiers only; not available in the Consumption tier)

Steps

Create Product

  1. Navigate to your API Management instance in the Azure portal.
  2. Select Products section from the menu on the left.
  3. Click + Add to add a new product.
  4. Provide a Display name for the product, such as "Serverless APIs" (everything between the quotes).
  5. The Id field will be automatically populated if you've provided a Display name, however you can choose to override it if you wish.
  6. Enter a Description for the product.
  7. Since we are using the API Management Consumption tier which does not include a Developer Portal, the publishing state of our product has no effect and we can just leave the default Not published setting.
  8. By default, Requires subscription is checked. This means that in order for a consumer to call the API, they will need to provide a subscription key.
  9. Click Select API and check the API(s) you imported from the previous exercise. Click Select.
  10. Click Create to complete your new API Management product.

Create a Product Subscription

We need to create a subscription in order to call our API as part of this product. A subscription is a set of two keys for associated APIs. You need to provide one of the subscription keys when invoking a protected API by providing the key in the Ocp-Apim-Subscription-Key HTTP header.

Since we created our API Management product to require subscriptions, we now need to create a subscription to that product to generate an initial set of keys to use.

  1. In your API Management instance in the Azure portal, select the Products section from the menu on the left.

  2. Select the product you created from the previous section. This will take you to the product overview for that product.

  3. Select the product Subscriptions menu option.

  4. Click + Add Subscription to add a new subscription for the product.

  5. Give the new subscription a Name (e.g. api-consumer-1) and a Display name (e.g. API Consumer 1).

  6. Click Yes for Allow tracing.

  7. Click Save.

  8. At this point, you should see your new subscription listed for the product. To view the actual key values for the subscription, click on the ellipses ... and then Show/hide keys menu option.

    Manage subscriptions

Related resources

Next steps

Apply policies and revisions