Skip to content

Azure Static Website - Quick Start Guide

This guide will help you deploy the Nutri-E website to Azure Storage in under 5 minutes.

Prerequisites

Quick Setup (5 minutes)

Step 1: Login to Azure (30 seconds)

az login

Your browser will open for authentication.

Step 2: Run Setup Script (2 minutes)

cd /Users/post/repos/github/nutri-e
./azure-setup.sh

The script will: - ✅ Create Azure resources - ✅ Upload your website - ✅ Generate GitHub credentials - ✅ Display your live website URL

Step 3: Configure GitHub Secrets (2 minutes)

The script outputs the secrets you need. Copy them to GitHub:

  1. Go to: https://github.com/Stig-Johnny/nutri-e/settings/secrets/actions
  2. Click "New repository secret"
  3. Add these three secrets:

Secret 1: AZURE_CREDENTIALS

{
  "clientId": "xxx",
  "clientSecret": "xxx",
  "subscriptionId": "xxx",
  "tenantId": "xxx"
}

Secret 2: AZURE_STORAGE_ACCOUNT

nutriewebsite

Secret 3: AZURE_RESOURCE_GROUP

nutri-e-rg

Step 4: Test Deployment (30 seconds)

# Make a test change
echo "<!-- Updated $(date) -->" >> website/index.html

# Commit and push
git add .
git commit -m "feat: add Azure deployment"
git push origin main

Go to GitHub Actions tab to watch the deployment!

Your Website is Live! 🎉

After setup, your website will be at:

https://[STORAGE_ACCOUNT].z16.web.core.windows.net

Example: https://nutriewebsite.z16.web.core.windows.net

What Happens Next?

Every time you push changes to website/ folder on the main branch: 1. GitHub Action automatically triggers 2. Files are uploaded to Azure Storage 3. Your website updates in ~30 seconds

Customization

Change Storage Account Name

AZURE_STORAGE_ACCOUNT="mywebsite" ./azure-setup.sh

Change Azure Region

AZURE_LOCATION="northeurope" ./azure-setup.sh

Deploy to Different Region

Available regions: - westeurope - West Europe (Amsterdam) - northeurope - North Europe (Dublin) - eastus - East US (Virginia) - westus - West US (California) - southeastasia - Southeast Asia (Singapore)

Troubleshooting

"Storage account name not available"

Storage account names must be globally unique. Try:

AZURE_STORAGE_ACCOUNT="nutrieweb$(date +%s)" ./azure-setup.sh

"Subscription not found"

Make sure you're logged in:

az logout
az login

GitHub Action fails

  1. Check secrets are set correctly (exact JSON format)
  2. Verify secret names match exactly (case-sensitive)
  3. Re-run the workflow

Cost

Expected monthly cost: $0.50 - $2.00 for a typical small website

Includes: - Storage (~$0.02/GB) - Bandwidth (first 5GB free) - Transactions (~$0.005/10K requests)

Next Steps

Full Documentation

See AZURE_DEPLOYMENT.md for complete documentation including: - Custom domain setup - CDN configuration - Monitoring and logs - Security best practices - Alternative deployment options

Support

  • Azure Issues: Check AZURE_DEPLOYMENT.md
  • GitHub Action Issues: Check workflow logs in Actions tab
  • Questions: Open an issue in the repository