快速入門:在 Azure 入口網站中建立認知服務帳戶Quickstart: Create a Cognitive Services account in the Azure portal

在本快速入門中,您將了解如何註冊 Azure 認知服務,並建立單一服務或多服務訂用帳戶。In this quickstart, you'll learn how to sign up for Azure Cognitive Services and create a single-service or multi-service subscription. 這些服務都是由 Azure 資源的形式呈現,可讓您連線到 Azure 認知服務 API 中的一個或多個 API。These services are represented by Azure resources, which enable you to connect to one or many of the Azure Cognitive Services APIs.

必要條件Prerequisites

建立並訂閱 Azure 認知服務資源Create and subscribe to an Azure Cognitive Services resource

開始之前,請務必注意有兩種類型的 Azure 認知服務訂用帳戶。Before you get started, it's important to know that there are two types of Azure Cognitive Services subscriptions. 第一個是單一服務訂用帳戶,例如電腦視覺或語音服務。The first is a subscription to a single service, such as Computer Vision or the Speech Services. 單一服務訂用帳戶僅限於該資源。A single-service subscription is restricted to that resource. 第二個是 Azure 認知服務的多服務訂用帳戶。The second is a multi-service subscription for Azure Cognitive Services. 此訂用帳戶可讓您使用適用於大部分 Azure 認知服務的單一訂用帳戶。This subscription allows you to use a single subscription for most of the Azure Cognitive Services. 此選項也會合併計費。This option also consolidates billing. 如需其他資訊,請參閱認知服務定價See Cognitive Services pricing for additional information.

警告

目前,以下服務支援多服務金鑰:QnA Maker、 語音服務、 自訂的視覺和異常偵測器。At this time, these services don't support multi-service keys: QnA Maker, Speech Services, Custom Vision, and Anomaly Detector.

下一節會引導您建立單一或多服務訂用帳戶。The next sections walk you through creating either a single or multi-service subscription.

多服務訂用帳戶Multi-service subscription

  1. 登入 Azure 入口網站,然後按一下 [+ 建立資源]。Sign in to the Azure portal, and click +Create a resource.

    選取認知服務 API

  2. 找到搜尋列,然後輸入:認知服務Locate the search bar and enter: Cognitive Services.

    搜尋認知服務

  3. 選取 [認知服務]。Select Cognitive Services.

    選取 [認知服務]

  4. 在 [建立] 頁面上,提供下列資訊:On the Create page, provide the following information:

    名稱Name 認知服務資源的描述性名稱。A descriptive name for your cognitive services resource. 我們建議使用描述性的名稱,例如 MyCognitiveServicesAccount。We recommend using a descriptive name, for example MyCognitiveServicesAccount.
    訂用帳戶Subscription 選取您其中一個可用的 Azure 訂用帳戶。Select one of your available Azure subscriptions.
    位置Location 您的認知服務執行個體的位置。The location of your cognitive service instance. 位置不同可能會造成延遲,但不會影響您資源執行階段的可用性。Different locations may introduce latency, but have no impact on the runtime availability of your resource.
    定價層Pricing tier 認知服務帳戶的費用取決於您選擇的選項和使用方式。The cost of your Cognitive Services account depends on the options you choose and your usage. 如需詳細資訊,請參閱 API 定價詳細資料For more information, see the API pricing details.
    資源群組Resource group Azure 資源群組,將包含您的認知服務資源。The Azure resource group that will contain your Cognitive Services resource. 您可以建立新的群組,或將群組新增到既有的群組。You can create a new group or add it to a pre-existing group.

    資源建立畫面

單一服務訂用帳戶Single-service subscription

  1. 登入 Azure 入口網站,然後按一下 [+ 建立資源]。Sign in to the Azure portal, and click +Create a resource.

    選取認知服務 API

  2. 在 [Azure Marketplace] 底下,選取 [AI + 機器學習服務]。Under Azure Marketplace, select AI + Machine Learning. 如果您沒看到感興趣的服務,請按一下 [查看全部],即可檢視認知服務 API 的完整目錄。If you don't see the service you're interested in, click on See all to view the entire catalog of Cognitive Services APIs.

    選取認知服務 API

  3. 在 [建立] 頁面上,提供下列資訊:On the Create page, provide the following information:

    名稱Name 認知服務資源的描述性名稱。A descriptive name for your cognitive services resource. 我們建議使用描述性的名稱,例如 MyNameFaceAPIAccountWe recommend using a descriptive name, for example MyNameFaceAPIAccount.
    訂用帳戶Subscription 選取您其中一個可用的 Azure 訂用帳戶。Select one of your available Azure subscriptions.
    位置Location 您的認知服務執行個體的位置。The location of your cognitive service instance. 位置不同可能會造成延遲,但不會影響您資源執行階段的可用性。Different locations may introduce latency, but have no impact on the runtime availability of your resource.
    定價層Pricing tier 認知服務帳戶的費用取決於您選擇的選項和使用方式。The cost of your Cognitive Services account depends on the options you choose and your usage. 如需詳細資訊,請參閱 API 定價詳細資料For more information, see the API pricing details.
    資源群組Resource group Azure 資源群組,將包含您的認知服務資源。The Azure resource group that will contain your Cognitive Services resource. 您可以建立新的群組,或將群組新增到既有的群組。You can create a new group or add it to a pre-existing group.

    資源建立畫面

存取您的資源Access your resource

注意

訂用帳戶擁有者可以藉由套用 Azure 原則、指派「不允許的資源類型」原則定義,以及指定 Microsoft.CognitiveServices/accounts 作為目標資源類型,針對資源群組或訂用帳戶停用認知服務帳戶的建立。Subscription owners can disable the creation of Cognitive Services accounts for resource groups and subscriptions by applying Azure policy, assigning a “Not allowed resource types” policy definition, and specifying Microsoft.CognitiveServices/accounts as the target resource type.

建立資源後,如果有釘選該資源,就可以在 Azure 儀表板上直接存取。After creating your resource, you can access it from the Azure dashboard if you pinned it. 若未釘選,可以在 [資源群組]中找到。Otherwise, you can find it in Resource Groups.

在認知服務資源中,您可以使用 [概觀] 區段中的端點 URL 和金鑰,開始在應用程式中進行 API 呼叫。Within your Cognitive Services resource, You can use the Endpoint URL and keys in the Overview section to start making API calls in your applications.

資源畫面

請記下的位置和索引鍵。Make a note of the location and the keys. 您可以選取來取得索引鍵按鍵下方資源管理You can get the keys by selecting Keys under Resource Management.

後續步驟Next steps

請參閱See also