Exercise 2: Static Websites
This exercise will show you how to get started with a static website.
Notes
These commands use files located in the current folder and should be executed locally. Make sure you install the Azure CLI: http://aka.ms/azcli.
You can also run the code from the following link: https://packt.link/0g3xg
- First, create the resource group:
az group create -l canadacentral -n AzureBlobsSync-RG
- To avoid name collisions, generate a unique name for your account:
account=azureblobsca$RANDOM
- Next, create an Azure storage account:
az storage account create --name $account --resource-group AzureBlobsSync-RG
echo $account
- Next, retrieve the key:
key=$(az storage account keys list --account-name $account --query [0].value -o tsv)
- Now, enable the static website:
az storage blob service-properties update --account-name $account --static-website --404-document 404.html --index-document index.html --account-key $key
- Upload files to the folder:
az storage...