Azure blob storage static website

Setup Azure Blob Storage

https://azure.microsoft.com/en-us/

## Login
az login 

az account list
SUBSCRIPTION_ID="e048164e-3eb6-413c-bfbc-3d6b8527f5c4"
az account set -s $SUBSCRIPTION_ID

## Create a resource group
az group create -n www-gestalts-net -l eastus

## Create Blob Storage
## Name must be between 3 and 24 characters and use numbers and lower-case letters only.
az storage account create -n wwwgestaltsnet \
    --kind StorageV2 \
    -l eastus \
    --https-only false \
    --sku Standard_LRS \
    -g www-gestalts-net

Enable Static web hosting on the storage account using the web console.

  • The az CLI has no option for enabling static web hosting.

  • Make note of the Primary Endpoint

Primary Endpoint: https://wwwgestaltsnet.z13.web.core.windows.net/

Upload the static website

##
## The *Account Name* is the *Storage Account*
## What on AWS S3 you would call a *Bucket Name*
##
## Upload to the $web container
##
az storage blob upload-batch \
  -s _site/ \
  -d \$web \
  --account-name wwwgestaltsnet

Setup Azure CDN

az cdn profile create -g www-gestalts-net -n wwwgestaltsnet --sku Standard_Microsoft -l eastus

Create a CNAME that points to the CDN Endpoint

www.gestalts.net -CNAME-> wwwgestaltsnet.azureedge.net

Enable Custom Domain Names on the CDN

Enable HTTPS on the CDN

Once validated, the cert will be signed by Digicert

categories: static-website | azure | jekyll |