- Azure account (free tier works)
- Azure CLI installed
- Python 3.11+ installed
- Azure Functions Core Tools v4
-
Install dependencies
pip install -r requirements.txt
-
Configure local settings
cp local.settings.json.template local.settings.json # Edit local.settings.json with your Azure Storage connection string -
Start the Function App
func start
-
Open the frontend
- Update
FUNCTION_URLin index.html tohttp://localhost:7071/api/SubmitAlert - Open index.html in a browser
- Update
# Login to Azure
az login --use-device-code
# Create resource group
az group create --name disaster-response-rg --location eastus
# Create storage + table
STORAGE_ACCOUNT=stgdisaster767816886
az storage account create --name $STORAGE_ACCOUNT --resource-group disaster-response-rg --location eastasia --sku Standard_LRS
az storage table create --name Alerts --account-name $STORAGE_ACCOUNT
# Create Function App (Python 3.11)
FUNCTION_APP=func-disaster-1767817356
az functionapp create --name $FUNCTION_APP --resource-group disaster-response-rg --consumption-plan-location eastasia --runtime python --runtime-version 3.11 --functions-version 4 --storage-account $STORAGE_ACCOUNT --os-type Linux
# Configure app settings
STORAGE_CONNECTION=$(az storage account show-connection-string --name $STORAGE_ACCOUNT --resource-group disaster-response-rg --query connectionString -o tsv)
az functionapp config appsettings set --name $FUNCTION_APP --resource-group disaster-response-rg --settings AZURE_STORAGE_CONNECTION_STRING="$STORAGE_CONNECTION" TABLE_NAME=Alertsfunc azure functionapp publish func-disaster-1767817356 --python# Update index.html with the function URL
# const FUNCTION_URL = 'https://func-disaster-1767817356.azurewebsites.net/api/SubmitAlert';
# Host via Static Web Apps or any static hostingcurl -X POST https://your-function-app.azurewebsites.net/api/SubmitAlert \
-H "Content-Type: application/json" \
-d '{
"location": "San Francisco, CA",
"type": "earthquake",
"severity": "high"
}'Before going to production, update:
- CORS settings in main.bicep (line 177-180)
- Authentication level in SubmitAlert/function.json (line 4)
- Function URL in index.html
- Consider adding monitoring and alerts
- Set up custom domain for Static Web App
- Enable Application Insights for logging
- Check Azure Function logs in portal
- Verify Azure Storage connection settings
- Ensure CORS is configured correctly
- Verify Storage connection string and table name
- Check that TABLE_NAME is set to Alerts
- Review Function App configuration
- Check browser console for errors
- Verify FUNCTION_URL is correct
- Test function endpoint directly with curl
For issues, check:
- README.md for detailed documentation
- Azure Portal logs for runtime errors
- GitHub Issues for community support