Azure App Service Troubleshooting
This guide helps you diagnose and resolve common issues you might encounter while running web apps, API apps, or mobile back‑ends on Azure App Service.
Common Issues
HTTP 502/503 Errors
These errors indicate that the front‑end cannot communicate with your app process.
- Check App Service logs for unhandled exceptions.
- Verify the App Service Plan has enough CPU/memory.
- Review Application Settings for misconfigured connection strings.
# Enable detailed error pages az webapp config set --resource-group MyRG --name MyApp --php-version 8.0
Slow Startup
Cold start latency can affect premium and consumption plans.
- Enable Always On in the configuration.
- Pre‑warm your app by sending a health probe.
- Consider moving to a higher tier or using Deployment Slots.
Diagnostic Tools
Azure provides a set of built‑in tools you can access from the portal or via CLI.
- Log Stream: Real‑time logs for troubleshooting.
- Kudu (Advanced Tools): File system access, process explorer, and more.
- App Service Diagnostics: Automated analysis and recommendations.
Sample Script – Retrieve Recent Logs
#!/bin/bash RESOURCE_GROUP="MyRG" APP_NAME="MyApp" az webapp log tail --resource-group $RESOURCE_GROUP --name $APP_NAME