Azure blob storage static website

Setup Azure Blob Storage

## Login
az login 

az account list
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:

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 -CNAME->

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 |