您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

快速入门:创建 Azure CDN 配置文件和终结点Quickstart: Create an Azure CDN profile and endpoint

在本快速入门中,请通过创建新的 Azure 内容分发网络 (CDN) 配置文件和 CDN 终结点来启用 CDN。In this quickstart, you enable Azure Content Delivery Network (CDN) by creating a new CDN profile and CDN endpoint. 创建配置文件和终结点以后,即可将内容交付给客户。After you have created a profile and an endpoint, you can start delivering content to your customers.

如果还没有 Azure 订阅,可以在开始前创建一个免费帐户If you don't have an Azure subscription, create a free account before you begin.

先决条件Prerequisites

就本快速入门来说,必须创建名为 mystorageacct123 的存储帐户,将其用作源服务器主机名。For the purposes of this quickstart, you must have created a storage account named mystorageacct123, which you use for the origin hostname. 有关详细信息,请参阅将 Azure 存储帐户与 Azure CDN 集成For more information, see Integrate an Azure storage account with Azure CDN.

登录到 Azure 门户Log in to the Azure portal

使用 Azure 帐户登录到 Azure 门户Log in to the Azure portal with your Azure account.

创建新的 CDN 配置文件Create a new CDN profile

CDN 配置文件是适用于 CDN 终结点的容器,用于指定定价层。A CDN profile is a container for CDN endpoints and specifies a pricing tier.

  1. 在 Azure 门户的左上角,选择“创建资源”。In the Azure portal, in the upper left, select Create a resource.

    此时会显示“新建”窗格。The New pane appears.

  2. 选择“Web + 移动”,然后选择“CDN”。Select Web + Mobile, then select CDN.

    选择 CDN 资源

    此时会显示“CDN 配置文件”窗格。The CDN profile pane appears.

  3. 对于 CDN 配置文件设置,请使用下表中指定的值:For the CDN profile settings, use the values specified in the following table:

    设置Setting Value
    名称Name 输入 my-cdn-profile-123 作为配置文件名称。Enter my-cdn-profile-123 for your profile name. 此名称必须全局唯一;如果此名称已在使用,则可输入其他名称。This name must be globally unique; if it is already in use, you may enter a different name.
    订阅Subscription 从下拉列表中选择一个 Azure 订阅。Select an Azure subscription from the drop-down list.
    资源组Resource group 选择“新建”,然后输入 my-resource-group-123 作为资源组名称。Select Create new and enter my-resource-group-123 for your resource group name. 该名称必须全局唯一。This name must be globally unique. 如果它已被使用,可以输入一个不同的名称,也可以选择“使用现有”并从下拉列表中选择 my-resource-group-123If it is already in use, you may enter a different name or you can select Use existing and select my-resource-group-123 from the drop-down list.
    资源组位置Resource group location 从下拉列表中选择“美国中部”。Select Central US from the drop-down list.
    定价层Pricing tier 从下拉列表中选择“标准 Verizon”。Select Standard Verizon from the drop-down list.
    立即创建新的 CDN 终结点Create a new CDN endpoint now 保持未选中状态。Leave unselected.

    新的 CDN 配置文件

  4. 选择“固定到仪表板”,以便在创建配置文件以后将其保存到仪表板。Select Pin to dashboard to save the profile to your dashboard after it is created.

  5. 选择“创建”以创建该配置文件。Select Create to create the profile.

    仅就来自 Microsoft 的 Azure CDN 标准版配置文件而言,配置文件通常可在两个小时内完成。For Azure CDN Standard from Microsoft profiles only, profile completion usually completes in two hours.

创建新的 CDN 终结点Create a new CDN endpoint

在创建 CDN 配置文件以后,即可用它来创建终结点。After you've created a CDN profile, you can use it to create an endpoint.

  1. 在 Azure 门户的仪表板中,选择已创建的 CDN 配置文件。In the Azure portal, select in your dashboard the CDN profile that you created. 如果找不到该文件,请选择“所有服务”,然后选择“CDN 配置文件”。If you can't find it, select All services, then select CDN profiles. 在“CDN 配置文件”页中,选择要使用的配置文件。In the CDN profiles page, select the profile that you want to use.

    此时会显示 CDN 配置文件页。The CDN profile page appears.

  2. 选择“终结点”。Select Endpoint.

    CDN 配置文件

    此时会显示“添加终结点”窗格。The Add an endpoint pane appears.

  3. 对于终结点设置,请使用下表中指定的值:For the endpoint settings, use the values specified in the following table:

    设置Setting Value
    NameName 输入 my-endpoint-123 作为终结点主机名。Enter my-endpoint-123 for your endpoint hostname. 此名称必须全局唯一;如果此名称已在使用,则可输入其他名称。This name must be globally unique; if it is already in use, you may enter a different name. 此名称用于访问在域 <终结点名称>.azureedge.net 中缓存的资源。This name is used to access your cached resources at the domain <endpoint name>.azureedge.net.
    源服务器类型Origin type 选择“存储”。Select Storage.
    源服务器主机名Origin hostname 输入 mystorageacct123.blob.core.windows.net 作为主机名。Enter mystorageacct123.blob.core.windows.net for your hostname. 此名称必须全局唯一;如果此名称已在使用,则可输入其他名称。This name must be globally unique; if it is already in use, you may enter a different name.
    源服务器路径Origin path 留空。Leave blank.
    源服务器主机标头Origin host header 保留默认的生成值。Leave the default generated value.
    协议Protocol 保留默认选择的 HTTPHTTPS 选项。Leave the default HTTP and HTTPS options selected.
    源服务器端口Origin port 保留默认的端口值。Leave the default port values.
    优化对象Optimized for 保留默认选择“常规 Web 交付”。Leave the default selection, General web delivery.

    “添加终结点”窗格

  4. 选择“添加”可创建新的终结点。Select Add to create the new endpoint.

    终结点在创建后出现在配置文件的终结点列表中。After the endpoint is created, it appears in the list of endpoints for the profile.

    CDN 终结点

    终结点不会立即可供使用,因为注册传播需花时间:Because it takes time for the registration to propagate, the endpoint isn't immediately available for use:

    • 对于 Microsoft 推出的 Azure CDN 标准版配置文件,传播通常可在 10 分钟内完成。For Azure CDN Standard from Microsoft profiles, propagation usually completes in 10 minutes.
    • 对于 Akamai 的 Azure CDN 标准版配置文件,传播通常可在一分钟内完成。For Azure CDN Standard from Akamai profiles, propagation usually completes within one minute.
    • 对于 Verizon 的 Azure CDN 标准版和 Verizon 的 Azure CDN 高级版配置文件,传播通常可在 90 分钟内完成。For Azure CDN Standard from Verizon and Azure CDN Premium from Verizon profiles, propagation usually completes within 90 minutes.

清理资源Clean up resources

在前面的步骤中,在资源组中创建了 CDN 配置文件和终结点。In the preceding steps, you created a CDN profile and an endpoint in a resource group. 若要转到后续步骤,以便了解如何向终结点添加自定义域,请保存这些资源。Save these resources if you want to go to Next steps and learn how to add a custom domain to your endpoint. 但是,如果认为将来不需要这些资源,可以通过删除资源组来删除它们,避免额外付费:However, if you don't expect to use these resources in the future, you can delete them by deleting the resource group, thus avoiding additional charges:

  1. 在 Azure 门户的左侧菜单中,选择“资源组”,然后选择“my-resource-group-123”。From the left-hand menu in the Azure portal, select Resource groups and then select my-resource-group-123.

  2. 在“资源组”页上选择“删除资源组”,在文本框中输入 my-resource-group-123,然后选择“删除”。On the Resource group page, select Delete resource group, enter my-resource-group-123 in the text box, then select Delete.

    此操作会删除在本快速入门中创建的资源组、配置文件和终结点。This action will delete the resource group, profile, and endpoint that you created in this quickstart.

后续步骤Next steps

若要了解如何向 CDN 终结点添加自定义域,请参阅以下教程:To learn about adding a custom domain to your CDN endpoint, see the following tutorial: