Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi Ian Brian
the fact that staging works while production doesn't, with identical code, means the issue is almost certainly environmental. Here's a focused checklist to help you pinpoint the root cause:
Connection Strings
- Compare connection strings in both slots via Azure Portal → App Service → Configuration.
Ensure no hidden differences (e.g. trailing spaces, casing, or slot-specific overrides).
Check if the connection string is marked as a slot setting—this prevents it from swapping between slots.
Managed Identity (if used)
- Confirm the production slot’s identity is enabled and has the correct Azure SQL permissions.
- Check if the identity is System-assigned or User-assigned, and whether it differs between slots. SQL Server Firewall
Verify that production slot’s outbound IPs are whitelisted in Azure SQL firewall settings.
You can find outbound IPs under App Service → Properties → Outbound IP Addresses.
Application Insights
- Look for SQL connection exceptions or timeouts in production logs.
- Compare telemetry between staging and production to spot anomalies.
Deployment Slot Behavior
Check if any startup tasks, warm-up scripts, or health checks differ between slots.
Try swapping staging into production temporarily to isolate whether the issue is slot-specific or environment-specific.
Clean Restart
Restart the production slot to flush any stale DNS or socket connections.
- Consider redeploying the production slot from scratch if corruption is suspected.
You can mark it 'Accept Answer' if this helped you.
Regards,
Vishvani