App Service Static Net Apps is a superb various to Azure Storage static web site internet hosting and can also be applicable in circumstances the place you do not require an internet server to render content material. App Service Static Net Apps give you a totally managed steady integration and steady supply (CI/CD) workflow from GitHub supply to international deployment.
When you want an internet server to render content material, you need to use Azure App Service.
Establishing a static web site
Static web site internet hosting is a characteristic that it’s important to allow on the storage account.
To allow static web site internet hosting, choose the title of your default file, after which optionally present a path to a customized 404 web page. If a blob storage container named $internet would not exist already within the account, one is created for you. Add the recordsdata of your web site to this container.
For step-by-step steerage, see Host a static web site in Azure Storage.
Recordsdata within the $internet container are case-sensitive, served via nameless entry requests and can be found solely via examine operations.
Importing content material
You need to use any of those instruments to add content material to the $internet container:
Viewing content material
Customers can view web site content material from a browser through the use of the general public URL of the web site. You will discover the URL through the use of the Azure portal, Azure CLI, or PowerShell. See Discover the web site URL.
If the server returns a 404 error, and you haven’t specified an error doc if you enabled the web site, then a default 404 web page is returned to the person.
The URL of your web site incorporates a regional code. For instance the URL
https://contosoblobaccount.z22.internet.core.home windows.web/ incorporates regional code
Whereas that code should stay within the URL, it is just for inner use, and you will not have to make use of that code in some other approach.
The index doc that you just specify if you allow static web site internet hosting, seems when customers open the positioning and do not specify a selected file (For instance:
When you arrange redundancy in a secondary area, you can even entry web site content material through the use of a secondary endpoint. As a result of information is replicated to secondary areas asynchronously, the recordsdata which can be accessible on the secondary endpoint aren’t at all times in sync with the recordsdata which can be accessible on the first endpoint.
Affect of the setting the general public entry degree of the online container
You may modify the general public entry degree of the $internet container, however this has no impression on the first static web site endpoint as a result of these recordsdata are served via nameless entry requests. Meaning public (read-only) entry to all recordsdata.
The next screenshot reveals the general public entry degree setting within the Azure portal:
Whereas the first static web site endpoint isn’t affected, a change to the general public entry degree does impression the first blob service endpoint.
For instance, if you happen to change the general public entry degree of the $internet container from Personal (no nameless entry) to Blob (nameless examine entry for blobs solely), then the extent of public entry to the first static web site endpoint
https://contosoblobaccount.z22.internet.core.home windows.web/index.html would not change.
Nevertheless, the general public entry to the first blob service endpoint
https://contosoblobaccount.blob.core.home windows.web/$internet/index.html does change from non-public to public. Now customers can open that file through the use of both of those two endpoints.
Disabling public entry on a storage account doesn’t have an effect on static web sites which can be hosted in that storage account. For extra info, see Configure nameless public examine entry for containers and blobs.
Mapping a customized area to a static web site URL
You can also make your static web site accessible by way of a customized area.
It is simpler to allow HTTP entry in your customized area, as a result of Azure Storage natively helps it. To allow HTTPS, you may have to make use of Azure CDN as a result of Azure Storage doesn’t but natively help HTTPS with customized domains. see Map a customized area to an Azure Blob Storage endpoint for step-by-step steerage.
If the storage account is configured to require safe switch over HTTPS, then customers should use the HTTPS endpoint.
Including HTTP headers
There is not any strategy to configure headers as a part of the static web site characteristic. Nevertheless, you need to use Azure CDN so as to add headers and append (or overwrite) header values. See Customary guidelines engine reference for Azure CDN.
If you wish to use headers to regulate caching, see Management Azure CDN caching habits with caching guidelines.
Multi-region web site internet hosting
When you plan to host an internet site in a number of geographies, we suggest that you just use a Content material Supply Community for regional caching. Use Azure Entrance Door if you wish to serve completely different content material in every area. It additionally gives failover capabilities. Azure Site visitors Supervisor isn’t really useful if you happen to plan to make use of a customized area. Points can come up due to how Azure Storage verifies customized domains.
You may allow static web site internet hosting freed from cost. You are billed just for the blob storage that your web site makes use of and operations prices. For extra particulars on costs for Azure Blob Storage, take a look at the Azure Blob Storage Pricing Web page.
You may allow metrics on static web site pages. As soon as you have enabled metrics, site visitors statistics on recordsdata within the $internet container are reported within the metrics dashboard.
To allow metrics in your static web site pages, see Allow metrics on static web site pages.