Skip to content

Commit 5dbb461

Browse files
authored
Merge pull request #101021 from normesta/normesta-static-websites
Static website, custom domain, and CDN overhaul
2 parents 4be8c2f + 0c0d254 commit 5dbb461

11 files changed

+309
-261
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44930,6 +44930,16 @@
4493044930
"redirect_url": "/azure/storage/common/storage-use-azcopy-v10",
4493144931
"redirect_document_id": false
4493244932
},
44933+
{
44934+
"source_path": "articles/storage/blobs/storage-blob-static-website-custom-domain.md",
44935+
"redirect_url": "/azure/storage/blobs/static-website-content-delivery-network",
44936+
"redirect_document_id": false
44937+
},
44938+
{
44939+
"source_path": "articles/storage/blobs/storage-https-custom-domain-cdn.md",
44940+
"redirect_url": "/azure/storage/blobs/storage-custom-domain-name#enable-https",
44941+
"redirect_document_id": false
44942+
},
4493344943
{
4493444944
"source_path": "articles/sql-database/sql-database-elastic-jobs-overview.md",
4493544945
"redirect_url": "/azure/sql-database/elastic-jobs-overview",

articles/storage/blobs/TOC.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@
8282
- name: 4 - Verify throughput and latency metrics
8383
href: storage-blob-scalable-app-verify-metrics.md
8484
- name: Host a static website
85-
items:
86-
- name: 1 - Create a static website
87-
href: storage-blob-static-website-host.md
88-
- name: 2 - Enable a custom domain with SSL
89-
href: storage-blob-static-website-custom-domain.md
85+
href: storage-blob-static-website-host.md
9086
- name: Design applications for high availability
9187
items:
9288
- name: 1 - Make your application highly available
@@ -383,10 +379,12 @@
383379
- name: Use the Azure Storage emulator
384380
href: ../common/storage-use-emulator.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
385381
- name: Host a static website
386-
href: storage-blob-static-website-how-to.md
387-
- name: Map Azure CDN to a custom domain for access over HTTPS
388-
href: storage-https-custom-domain-cdn.md
389-
- name: Configure a custom domain
382+
items:
383+
- name: Host a static website
384+
href: storage-blob-static-website-how-to.md
385+
- name: Integrate with Azure CDN
386+
href: static-website-content-delivery-network.md
387+
- name: Use a custom domain
390388
href: storage-custom-domain-name.md
391389
- name: Route events to a custom endpoint
392390
href: storage-blob-event-quickstart.md
6.53 KB
Loading
15.6 KB
Loading
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Integrate a static website with Azure CDN - Azure Storage
3+
description: Learn how to cache static website content from an Azure Storage account by using Azure Content Delivery Network (CDN).
4+
author: normesta
5+
ms.service: storage
6+
ms.subservice: blobs
7+
ms.topic: conceptual
8+
ms.author: normesta
9+
ms.date: 01/22/2020
10+
---
11+
12+
# Integrate a static website with Azure CDN
13+
14+
You can enable [Azure Content Delivery Network (CDN)](../../cdn/cdn-overview.md) to cache content from a [static website](storage-blob-static-website.md) that is hosted in an Azure storage account. You can use Azure CDN to configure the custom domain endpoint for your static website, provision custom SSL certificates, and configure custom rewrite rules. Configuring Azure CDN results in additional charges, but provides consistent low latencies to your website from anywhere in the world. Azure CDN also provides SSL encryption with your own certificate.
15+
16+
For information on Azure CDN pricing, see [Azure CDN pricing](https://azure.microsoft.com/pricing/details/cdn/).
17+
18+
## Enable Azure CDN for your static website
19+
20+
You can enable Azure CDN for your static website directly from your storage account. If you want to specify advanced configuration settings for your CDN endpoint, such as [large file download optimization](../../cdn/cdn-optimization-overview.md#large-file-download), you can instead use the [Azure CDN extension](../../cdn/cdn-create-new-endpoint.md) to create a CDN profile and endpoint.
21+
22+
1. Locate your storage account in the Azure portal and display the account overview.
23+
24+
2. Select **Azure CDN** under the **Blob Service** menu to configure Azure CDN.
25+
26+
The **Azure CDN** page appears.
27+
28+
![Create CDN endpoint](../../cdn/media/cdn-create-a-storage-account-with-cdn/cdn-storage-new-endpoint-creation.png)
29+
30+
3. In the **CDN profile** section, specify a new or existing CDN profile.
31+
32+
4. Specify a pricing tier for the CDN endpoint. To learn more about pricing, see [Content Delivery Network pricing](https://azure.microsoft.com/pricing/details/cdn/). For more information about the features available with each tier, see [Compare Azure CDN product features](../../cdn/cdn-features.md).
33+
34+
5. In the **CDN endpoint name** field, specify a name for your CDN endpoint. The CDN endpoint must be unique across Azure.
35+
36+
6. Specify your the static website endpoint in the **Origin hostname** field.
37+
38+
To find your static website endpoint, navigate to the **Static website** settings for your storage account. Copy the primary endpoint and paste it into the CDN configuration.
39+
40+
> [!IMPORTANT]
41+
> Make sure to remove the protocol identifier (*e.g.*, HTTPS) and the trailing slash in the URL. For example, if the static website endpoint is
42+
> `https://mystorageaccount.z5.web.core.windows.net/`, then you would specify `mystorageaccount.z5.web.core.windows.net` in the **Origin hostname** field.
43+
44+
The following image shows an example endpoint configuration:
45+
46+
![Screenshot showing sample CDN endpoint configuration](media/storage-blob-static-website-custom-domain/add-cdn-endpoint.png)
47+
48+
7. Select **Create**, and then wait for it to propagate. After the endpoint is created, it appears in the endpoint list.
49+
50+
8. To verify that the CDN endpoint is configured correctly, click on the endpoint to navigate to its settings. From the CDN overview for your storage account, locate the endpoint hostname, and navigate to the endpoint, as shown in the following image. The format of your CDN endpoint will be similar to `https://staticwebsitesamples.azureedge.net`.
51+
52+
![Screenshot showing overview of CDN endpoint](media/storage-blob-static-website-custom-domain/verify-cdn-endpoint.png)
53+
54+
9. Once the CDN endpoint propagation is complete, navigating to the CDN endpoint displays the contents of the index.html file that you previously uploaded to your static website.
55+
56+
10. To review the origin settings for your CDN endpoint, navigate to **Origin** under the **Settings** section for your CDN endpoint. You will see that the **Origin type** field is set to *Custom Origin* and that the **Origin hostname** field displays your static website endpoint.
57+
58+
![Screenshot showing Origin settings for CDN endpoint](media/storage-blob-static-website-custom-domain/verify-cdn-origin.png)
59+
60+
## Remove content from Azure CDN
61+
62+
If you no longer want to cache an object in Azure CDN, you can take one of the following steps:
63+
64+
* Make the container private instead of public. For more information, see [Manage anonymous read access to containers and blobs](storage-manage-access-to-resources.md).
65+
* Disable or delete the CDN endpoint by using the Azure portal.
66+
* Modify your hosted service to no longer respond to requests for the object.
67+
68+
An object that's already cached in Azure CDN remains cached until the time-to-live period for the object expires or until the endpoint is [purged](../../cdn/cdn-purge-endpoint.md). When the time-to-live period expires, Azure CDN determines whether the CDN endpoint is still valid and the object is still anonymously accessible. If they are not, the object will no longer be cached.
69+
70+
## Next steps
71+
72+
(Optional) Add a custom domain to your Azure CDN endpoint. See [Tutorial: Add a custom domain to your Azure CDN endpoint](../../cdn/cdn-map-content-to-custom-domain.md).

articles/storage/blobs/storage-blob-static-website-custom-domain.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

articles/storage/blobs/storage-blob-static-website-host.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: normesta
55
ms.service: storage
66
ms.subservice: blobs
77
ms.topic: tutorial
8-
ms.date: 10/22/2019
8+
ms.date: 1/22/2020
99
ms.author: normesta
1010
ms.reviewer: dineshm
1111
---
@@ -14,9 +14,9 @@ ms.reviewer: dineshm
1414

1515
# Tutorial: Host a static website on Blob Storage
1616

17-
This tutorial is part one of a series. In it, you learn how to build and deploy a static website to Azure Storage. When you're finished, you will have a static website that users can access publicly.
17+
In this tutorial, you'll learn how to build and deploy a static website to Azure Storage. When you're finished, you will have a static website that users can access publicly.
1818

19-
In part one of the series, you learn how to:
19+
In this tutorial, you learn how to:
2020

2121
> [!div class="checklist"]
2222
> * Configure static website hosting
@@ -94,9 +94,9 @@ You’ve successfully completed the tutorial and deployed a static website to Az
9494
9595
## Next steps
9696
97-
In part one of this tutorial, you learned how to configure your Azure Storage account for static website hosting, and how to create and deploy a static website to an Azure endpoint.
97+
In this tutorial, you learned how to configure your Azure Storage account for static website hosting, and how to create and deploy a static website to an Azure endpoint.
9898
99-
Now advance to part two, where you configure a custom domain with SSL for your static website with Azure CDN.
99+
Next, learn how to configure a custom domain with your static website.
100100
101101
> [!div class="nextstepaction"]
102-
> [Use Azure CDN to enable a custom domain with SSL for a static website](storage-blob-static-website-custom-domain.md)
102+
> [Map a custom domain to an Azure Blob Storage endpoint](storage-custom-domain-name.md)

articles/storage/blobs/storage-blob-static-website-how-to.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,5 @@ Once you've enabled metrics, traffic statistics on files in the **$web** contain
216216

217217
## Next steps
218218

219-
* [Static website hosting in Azure Storage](storage-blob-static-website.md)
220-
* [Use the Azure CDN to access blobs with custom domains over HTTPS](storage-https-custom-domain-cdn.md)
221-
* [Configure a custom domain name for your blob or web endpoint](storage-custom-domain-name.md)
222-
* [Azure Functions](/azure/azure-functions/functions-overview)
223-
* [Azure App Service](/azure/app-service/overview)
224-
* [Build your first serverless web app](https://docs.microsoft.com/azure/functions/tutorial-static-website-serverless-api-with-database)
225-
* [Tutorial: Host your domain in Azure DNS](../../dns/dns-delegate-domain-azure-dns.md)
219+
* Learn how to configure a custom domain with your static website. See [Map a custom domain to an Azure Blob Storage endpoint](storage-custom-domain-name.md).
220+

articles/storage/blobs/storage-blob-static-website.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,16 @@ For example, if you change the public access level of the **$web** container fro
7676

7777
However, the public access to the primary blob service endpoint `https://contosoblobaccount.blob.core.windows.net/$web/index.html` does change from private to public. Now users can open that file by using either of these two endpoints.
7878

79-
## Content Delivery Network (CDN) and Secure Socket Layer (SSL) support
79+
## Mapping a custom domain to a static website URL
8080

81-
To make your static website files available over your custom domain and HTTPS, see [Using the Azure CDN to access blobs with custom domains over HTTPS](storage-https-custom-domain-cdn.md). As a part of this process, you need to point your CDN to the primary *static website* endpoint as opposed to the primary *blob service* endpoint. You might need to wait a few minutes before your content is visible as the CDN configuration is not immediately executed.
81+
You can make your static website available via a custom domain.
8282

83-
When you update your static website, be sure to clear cached content on the CDN edge servers by purging the CDN endpoint. For more information, see [Purge an Azure CDN endpoint](../../cdn/cdn-purge-endpoint.md).
83+
It's easier to enable HTTP access for your custom domain, because Azure Storage natively supports it. To enable HTTPS, you'll have to use Azure CDN because Azure Storage does not yet natively support HTTPS with custom domains. see [Map a custom domain to an Azure Blob Storage endpoint](storage-custom-domain-name.md) for step-by-step guidance.
8484

85-
> [!NOTE]
86-
> HTTPS is supported natively through the account web endpoint, so the web endpoint is accessible via both HTTP and HTTPS. However, if the storage account is configured to require secure transfer over HTTPS, then users must use the HTTPS endpoint. For more information, see [Require secure transfer in Azure Storage](../common/storage-require-secure-transfer.md).
87-
>
88-
> The use of custom domains over HTTPS requires the use of Azure CDN at this time.
89-
90-
## Custom domain names
91-
92-
You can make your static website available via a custom domain. To learn more, see [configure a custom domain name for your Azure Storage account](storage-custom-domain-name.md).
85+
If the storage account is configured to [require secure transfer](../common/storage-require-secure-transfer.md) over HTTPS, then users must use the HTTPS endpoint.
9386

94-
For an in-depth look at hosting your domain on Azure, see [Host your domain in Azure DNS](../../dns/dns-delegate-domain-azure-dns.md).
87+
> [!TIP]
88+
> Consider hosting your domain on Azure. For more information, see [Host your domain in Azure DNS](../../dns/dns-delegate-domain-azure-dns.md).
9589
9690
## Pricing
9791

@@ -106,8 +100,7 @@ To enable metrics on your static website pages, see [Enable metrics on static we
106100
## Next steps
107101

108102
* [Host a static website in Azure Storage](storage-blob-static-website-how-to.md)
109-
* [Use the Azure CDN to access blobs with custom domains over HTTPS](storage-https-custom-domain-cdn.md)
110-
* [Configure a custom domain name for your blob or web endpoint](storage-custom-domain-name.md)
103+
* [Map a custom domain to an Azure Blob Storage endpoint](storage-custom-domain-name.md)
111104
* [Azure Functions](/azure/azure-functions/functions-overview)
112105
* [Azure App Service](/azure/app-service/overview)
113106
* [Build your first serverless web app](https://docs.microsoft.com/azure/functions/tutorial-static-website-serverless-api-with-database)

0 commit comments

Comments
 (0)