建立和發行產品Create and publish a product

在 Azure API 管理中,產品包含一或多個 API,以及使用量配額與使用規定。In Azure API Management, a product contains one or more APIs as well as a usage quota and the terms of use. 發行產品之後,開發人員便可訂閱產品,並開始使用產品的 API。Once a product is published, developers can subscribe to the product and begin to use the product's APIs.

在本教學課程中,您了解如何:In this tutorial, you learn how to:

  • 建立和發行產品Create and publish a product
  • 將 API 新增至產品Add an API to the product

新增產品教學課程

必要條件Prerequisites

建立和發行產品Create and publish a product

Add product

  1. 按一下左邊功能表中的 [產品] ,以顯示 [產品] 頁面。Click on Products in the menu on the left to display the Products page.

  2. 按一下 [+ 新增] 。Click + Add.

    當您新增產品時,您需要提供下列資訊:When you add a product, you need to supply the following information:

    NameName 說明Description
    顯示名稱Display name 您想要其顯示在開發人員入口網站中的名稱。The name as you want it to be shown in the Developer portal.
    NameName 產品的描述性名稱。A descriptive name of the product.
    說明Description [說明] 欄位可讓您提供產品的詳細資訊,例如用途、產品可供其存取的 API 及其他有用的資訊。The Description field allows you to provide detailed information about the product such as its purpose, the APIs it provides access to, and other useful information.
    StateState 如果您想要發行產品,請按 [發行] 。Press Published if you want to publish the product. 產品必須發行,才能呼叫產品中的 API。Before the APIs in a product can be called, the product must be published. 依預設不會發行新產品,且只有 [Administrators] 群組才能看見。By default new products are unpublished, and are visible only to the Administrators group.
    需要訂用帳戶Requires subscription 如果使用者必須先訂閱才可使用產品,請核取 [需要訂用帳戶] 。Check Require subscription if a user is required to subscribe to use the product.
    需要核准Requires approval 如果您希望管理員檢閱並接受或拒絕對此產品的訂閱嘗試,請核取 [需要核准] 。Check Require approval if you want an administrator to review and accept or reject subscription attempts to this product. 如果未核取方塊,將會自動核准訂閱嘗試。If the box is unchecked, subscription attempts are auto-approved.
    訂閱計數限制Subscription count limit 若要限制多個訂閱同時進行的計數,請輸入訂閱限制。To limit the count of multiple simultaneous subscriptions, enter the subscription limit.
    法律條款Legal terms 您可以包含訂閱者必須接受才可使用產品的產品使用規定。You can include the terms of use for the product which subscribers must accept in order to use the product.
    APIAPIs 產品是一或多個 API 的關聯。Products are associations of one or more APIs. 您可以包括數個 API,並透過開發人員入口網站將它們提供給開發人員。You can include a number of APIs and offer them to developers through the developer portal.
    在產品建立期間,您可以新增現有的 API。You can add an existing API during the product creation. 您可以在之後將 API 新增至產品中,可以從產品的 [設定] 頁面或建立 API 時進行新增。You can add an API to the product later, either from the Products Settings page or while creating an API.
  3. 按一下 [建立] 來建立新產品。Click Create to create the new product.

新增更多設定Add more configurations

將其儲存之後,您可以選擇 [設定] 索引標籤,繼續設定產品。You can continue configuring the product after saving it by choosing the Settings tab.

從 [訂用帳戶] 索引標籤中,檢視/新增產品訂閱者。View/add subscribers to the product from the Subscriptions tab.

從 [存取控制] 索引標籤中,設定開發人員或來賓適用的產品可見性。Set visibility of a product for developers or guest from the Access control tab.

將 API 加入至產品 Add APIs to a product

產品是一或多個 API 的關聯。Products are associations of one or more APIs. 您可以包括數個 API,並透過開發人員入口網站將它們提供給開發人員。You can include a number of APIs and offer them to developers through the developer portal. 在產品建立期間,您可以新增現有的 API。You can add an existing API during the product creation. 您可以在之後將 API 新增至產品中,可以從產品的 [設定] 頁面或建立 API 時進行新增。You can add an API to the product later, either from the Products Settings page or while creating an API.

開發人員必須先訂閱產品,才能取得 API 的存取權。Developers must first subscribe to a product to get access to the API. 當他們訂閱時,就能取得適用於該產品中任何 API 的中訂用帳戶金鑰。When they subscribe, they get a subscription key that is good for any API in that product. 如果您建立了 APIM 執行個體,您就已經是系統管理員,因此根據預設,您已訂閱每一項產品。If you created the APIM instance, you are an administrator already, so you are subscribed to every product by default.

將 API 新增至現有的產品Add an API to an existing product

新增產品 API

  1. 在 [產品] 索引標籤上選取產品。From the Products tab, select a product.
  2. 瀏覽至 [API] 索引標籤。Navigate to the APIs tab.
  3. 按一下 [+ 新增] 。Click + Add.
  4. 選擇 API,然後按一下 [選取] 。Choose an API and click Select.

提示

您可以透過 REST API 或 PowerShell 命令,使用自訂的訂用帳戶金鑰建立或更新使用者的產品訂用帳戶。You can create or update user's subscription to a Product with custom subscription keys through REST API or PowerShell command.

後續步驟Next steps

在本教學課程中,您已了解如何:In this tutorial, you learned how to:

  • 建立和發行產品Create and publish a product
  • 將 API 新增至產品Add an API to the product

前進到下一個教學課程:Advance to the next tutorial: