认知服务的自定义子域名Custom subdomain names for Cognitive Services

对于通过 Azure 门户Azure CLI 创建的每个资源,Azure 认知服务使用自定义子域名。Azure Cognitive Services use custom subdomain names for each resource created through the Azure portal or Azure CLI. 不同于特定 Azure 区域中所有客户经常使用的区域终结点,自定义子域名对于资源是唯一的。Unlike regional endpoints, which were common for all customers in a specific Azure region, custom subdomain names are unique to the resource. 需要使用自定义子域名来启用 Azure Active Directory (Azure AD) 等功能进行身份验证。Custom subdomain names are required to enable features like Azure Active Directory (Azure AD) for authentication.

这会对现有资源造成怎样的影响?How does this impact existing resources?

在 2019 年 7 月 1 日之前创建的认知服务资源将使用关联服务的区域终结点。Cognitive Services resources created before July 1, 2019 will use the regional endpoints for the associated service. 这些终结点将适用于现有资源和新资源。These endpoints will work with existing and new resources.

若要迁移现有资源来利用自定义子域名,以便能够启用 Azure AD 等功能,请按以下说明操作:If you'd like to migrate an existing resource to leverage custom subdomain names, so that you can enable features like Azure AD, follow these instructions:

  1. 登录到 Azure 门户,找到要将自定义子域名添加到的认知服务资源。Sign in to the Azure portal and locate the Cognitive Services resource that you'd like to add a custom subdomain name to.
  2. 在“概述”边栏选项卡中,找到并选择“生成自定义域名”。 In the Overview blade, locate and select Generate Custom Domain Name.
  3. 此时会打开一个面板,其中包含有关为资源创建唯一自定义子域的说明。This opens a panel with instructions to create a unique custom subdomain for your resource.

    警告

    创建自定义子域名后,无法对其进行更改。After you've created a custom subdomain name it cannot be changed.

是否需要更新现有的资源?Do I need to update my existing resources?

否。No. 区域终结点仍旧适用于新的和现有的认知服务,而自定义子域名是可选的。The regional endpoint will continue to work for new and existing Cognitive Services and the custom subdomain name is optional. 即使添加了自定义子域名,区域终结点也仍适用于该资源。Even if a custom subdomain name is added the regional endpoint will continue to work with the resource.

如果 SDK 要求提供资源的区域,该怎么办?What if an SDK asks me for the region for a resource?

警告

语音服务目前支持自定义子域。The Speech Services do not support custom subdomains at this time. 在使用语音服务和关联的 SDK 时,请使用区域终结点。Please use the regional endpoints when using the Speech Services and associated SDKs.

区域终结点和自定义子域名均受支持,且可换用。Regional endpoints and custom subdomain names are both supported and can be used interchangeably. 但是,必须提供完整的终结点。However, the full endpoint is required.

Azure 门户中资源的“概述”边栏选项卡内提供了区域信息。Region information is available in the Overview blade for your resource in the Azure portal. 有关区域终结点的完整列表,请参阅是否有区域终结点的列表?For the full list of regional endpoints, see Is there a list of regional endpoints?

自定义子域名是否是区域性的?Are custom subdomain names regional?

是的。Yes. 使用自定义子域名不会改变认知服务资源的任何区域性质。Using a custom subdomain name doesn't change any of the regional aspects of your Cognitive Services resource.

自定义子域名的要求是什么?What are the requirements for a custom subdomain name?

自定义子域名对于资源是唯一的。A custom subdomain name is unique to your resource. 该名称只能包含字母数字字符和 - 字符;长度为 2 到 64 个字符,不能以 - 结尾。The name can only include alphanumeric characters and the - character; it must be between 2 and 64 characters in length and cannot end with a -.

是否可以更改自定义域名?Can I change a custom domain name?

否。No. 创建自定义子域名称并将其关联到资源后,无法对其进行更改。After a custom subdomain name is created and associated with a resource it cannot be changed.

是否可以重复使用某个自定义域名?Can I reuse a custom domain name?

每个自定义子域名都是唯一的,因此,若要重复使用已分配给认知服务资源的自定义子域名,需要删除现有的资源。Each custom subdomain name is unique, so in order to reuse a custom subdomain name that you've assigned to a Cognitive Services resource, you'll need to delete the existing resource. 删除资源后,即可重复使用该自定义子域名。After the resource has been deleted, you can reuse the custom subdomain name.

是否有区域终结点的列表?Is there a list of regional endpoints?

是的。Yes. 下面提供了可用于 Azure 认知服务资源的区域终结点列表。This is a list of regional endpoints that you can use with Azure Cognitive Services resources.

备注

文本翻译 API 使用全局终结点。The Translator Text API use global endpoints.

终结点类型Endpoint type 区域Region 终结点Endpoint
中国China 中国东部 2China East 2 https://chinaeast2.api.cognitive.azure.cn
中国北部China North https://chinanorth.api.cognitive.azure.cn

另请参阅See also