Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Static Website Hosting

Is there any way to host static website (HTML + CSS + JS) in Azure? Like we do Amazon S3 Static Website hosting, they charge only for storage.

like image 253
syv Avatar asked Apr 21 '16 16:04

syv


3 Answers

UPDATE: 29-June-2018

It is now possible to host static websites in Azure Storage. You can read more about it here: https://docs.microsoft.com/en-gb/azure/storage/blobs/storage-blob-static-website


As of today, no. Azure doesn't have an equivalent of that. You can however host static sites as Web Apps and for free as well if you're comfortable with the restrictions with free tier.

like image 146
Gaurav Mantri Avatar answered Oct 05 '22 14:10

Gaurav Mantri


It's not officially supported, but if you hosted your site in Azure Blob Storage's root container and made the container publicly accessible, you could probably achieve the same affect. You can even give the blob storage account a custom domain name.

Only downside is that you'll have to figure out a good deployment story. Two of your options are to use an FTP-like client such as CloudBerry to manually deploy your site, or write your own deployment script using the blob storage api

like image 42
Zain Rizvi Avatar answered Oct 05 '22 14:10

Zain Rizvi


I found a way to host a static website in an Azure blob, using a subdomain and an http re-direct

I do the following

1) In Azure I create a storage account with a container ( called docs ) that has Blob access policy.

2) I upload my static website to the docs container using the storage explorer. This includes some PHP files in a sub folder.

3) In the DNS I set up a cname record for a subdomain ( called info say) with alias myblob.blob.core.windows.net ( where myblob is the name of my blob)

4) In the DNS I create an Http redirect for record to a file on the subdomain for www with url http://info.mydomainname.com/docs/index.html

5) In Azure I create a custom domain for info.mydomainname.com

My website then works however if someone knows the location of the PHP files then they can download them which means I must not store secrets in them.

I have asked if there is a work around here

like image 27
Kirsten Avatar answered Oct 05 '22 14:10

Kirsten