My personal webpage https://www.cloudydev.net/
Find a file
2025-03-31 22:15:29 +02:00
.github/workflows Update main.yml 2023-08-11 20:43:46 +02:00
docs Update resume.md 2025-03-31 22:15:29 +02:00
io_tools@a15eed127c adding in more of the CI/CD stuff 2022-01-03 14:49:38 +01:00
.gitignore cleanu 2021-11-27 14:50:57 +01:00
.stylelintrc.json cleanu 2021-11-27 14:50:57 +01:00
mkdocs.yml remove google fonts, simplify design 2023-10-17 11:39:21 +02:00
README.md Update README.md 2022-07-28 19:27:27 +02:00

Static website hosting for ~$0.05 /month

How I host my personal site in an Azure Storage Blob.

1. Install the Azure CLI

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

2. Log In

az login

3. List Subscriptions

 az account list -o table                     
Name           CloudName    SubscriptionId                            State    IsDefault
-------------  -----------  ------------------------------------      -------  -----------
cloudydev.net  AzureCloud   d520e0d1-8ce2-4bf3-bb06-443ee372cfec      Enabled  True
    ```

4. Export variables and keep things DRY

export KIND="StorageV2"
export LOCATION="westeurope"
export SUBSCRIPTION="cloudydev.net"
export RG_NAME="cloudydev-docs"
export STORAGE_NAME="cloudydevdata"
export STORAGE_SKU="Standard_RAGRS"
export ERROR_DOC="index.html"
export INDEX_DOC="index.html"
export SITE_ROOT_FOLDER="site"

5. Set subscription

az account set --subscription="${SUBSCRIPTION}"

6. Create a resource group

az group create \
  -l="${LOCATION}" \
  -n="${RG_NAME}"

7. Create storage account

  az storage account create \
    --name="${STORAGE_NAME}" \
    --resource-group="${RG_NAME}" \
    --location="${LOCATION}" \
    --sku="${STORAGE_SKU}" \
    --kind="${KIND}"

8. Enable static website hosting

  az storage blob service-properties update \
    --account-name="${STORAGE_NAME}" \
    --static-website \
    --404-document="${ERROR_DOC}" \
    --index-document="${INDEX_DOC}" \
    --auth-mode login

9. Upload Files

 az storage blob upload-batch \
     -s "${SITE_ROOT_FOLDER}" \
     -d '$web' \
     --account-name="${STORAGE_NAME}"

10. Get the URL

az storage account show \
  -n "${STORAGE_NAME}" \
  -g "${RG_NAME}" \
  --query "primaryEndpoints.web" \
  --output tsv
# https://cloudydevdata.z6.web.core.windows.net/