ðĨ Azure Function App Errors: Common Issues, Error Codes & Troubleshooting Guide
Azure Functions are powerful for building serverless applications, but when you start integrating them with storage accounts, queues, APIs, and VNets, errors pop up quickly.
In this guide, I’ll cover the most common Function App errors with error codes, symptoms, and step-by-step troubleshooting.
⚡ 1. Cold Start Delay
- Symptoms: First request is very slow (Consumption plan).
- Error Codes: No explicit error code, only high initialization time in logs/App Insights.
- Fix:
- Use Premium/Dedicated plans instead of Consumption.
- Enable Always On (for App Service plan).
- Add a timer trigger to keep app warm.
⚡ 2. Function Timeout
- Symptoms: Request cut off after 5 minutes.
- Error Codes:
503 Service Unavailable,FunctionTimeout. - Fix:
- Update
host.json→ increasefunctionTimeout. - Use Durable Functions for long-running tasks.
- Move to Premium plan for higher timeout limits.
- Update
⚡ 3. Trigger Binding Errors
- Symptoms: Function never fires, startup logs show errors.
- Error Codes:
Microsoft.Azure.WebJobs.Host: Error indexing method 'FunctionName'The binding type(s) ... are not registered
- Fix:
- Verify
function.jsonand connection strings. - Ensure binding extensions are installed.
- Double-check queue name, storage account name, etc.
- Verify
⚡ 4. Dependency Injection Failures
- Symptoms: App crashes on startup.
- Error Codes:
InvalidOperationException: Unable to resolve service for type ... - Fix:
- Register all services in
Startup.cs. - Match lifetimes (Transient/Scoped/Singleton).
- Avoid injecting scoped services into singletons.
- Register all services in
⚡ 5. Missing App Settings / Secrets
- Symptoms: Functions throw
NullReferenceException. - Error Codes:
System.ArgumentNullException: Value cannot be nullAzureWebJobsStorage not found
- Fix:
- Check Application Settings in the portal.
- Use Key Vault references.
- For local dev, configure
local.settings.json.
⚡ 6. Storage Connection Issues
- Symptoms: Triggers don’t fire, storage access denied.
- Error Codes:
403 Forbidden,404 ResourceNotFound,409 Conflict. - Fix:
- Validate
AzureWebJobsStorage. - Check firewall/VNet rules.
- Ensure managed identity or RBAC is properly set.
- Validate
⚡ 7. Authentication Failures (AAD)
- Symptoms: API calls fail with 401/403.
- Error Codes:
401 Unauthorized,403 ForbiddenAADSTS7000215: Invalid client secret provided
- Fix:
- Check app registration and API permissions.
- Decode JWT at jwt.ms.
- Validate
aud(audience) andscp(scopes).
⚡ 8. Deployment Errors
- Symptoms: Function doesn’t deploy properly.
- Error Codes:
Deployment Failed with Code: ConflictZipDeploy Error: Cannot find function runtime
- Fix:
- Check Kudu logs.
- Ensure
FUNCTIONS_EXTENSION_VERSIONis correct. - Match runtime stack (.NET Isolated vs In-Process).
⚡ 9. Package / Assembly Errors
- Symptoms: Function crashes after deployment.
- Error Codes:
System.IO.FileNotFoundException: Could not load file or assembly. - Fix:
- Validate
.csprojreferences. - Run
dotnet publishlocally before deploying. - Avoid mismatched package versions.
- Validate
⚡ 10. Scaling & Performance Issues
- Symptoms: Slow execution, backlog of queue messages.
- Error Codes: No explicit code, visible in host metrics.
- Fix:
- Tune host.json (
maxConcurrentRequests, batch size). - Upgrade to Premium for predictable scaling.
- Monitor metrics in App Insights.
- Tune host.json (
⚡ 11. Durable Functions Failures
- Symptoms: Orchestration stuck or fails.
- Error Codes:
System.InvalidOperationException: Instance already existsStorageException: Table not found
- Fix:
- Confirm
DurableTasktables exist in Storage. - Monitor orchestration status in App Insights.
- Handle retries gracefully.
- Confirm
⚡ 12. CORS / API Integration Issues
- Symptoms: Browser blocks requests.
- Error Codes:
No 'Access-Control-Allow-Origin' header. - Fix:
- Add origins in CORS settings in Function App.
- Ensure preflight (OPTIONS) requests aren’t blocked.
⚡ 13. Logging Issues
- Symptoms: No logs visible in App Insights.
- Error Codes: No explicit error, logs missing.
- Fix:
- Enable Application Insights in portal.
- Verify instrumentation key / connection string.
- Check telemetry ingestion quotas.
⚡ 14. Invalid Function/Host Key
- Symptoms: Calls to function rejected.
- Error Codes:
401 Unauthorized: Host key not valid. - Fix:
- Regenerate keys in portal.
- Use correct key type (host, function, system).
⚡ 15. Service Bus / Event Hub Issues
- Symptoms: Messages land in DLQ.
- Error Codes:
Message moved to DLQ after max delivery count. - Fix:
- Inspect DLQ using Service Bus Explorer.
- Add retries, implement DLQ processing.
- Improve error handling in function.
⚡ 16. Networking / VNet Integration Errors
- Symptoms: Function cannot reach SQL, storage, or APIs.
- Error Codes:
403 Forbidden,Request timed out, SQL error10060. - Fix:
- Enable VNet integration.
- Verify NSG/firewall rules.
- Configure private DNS for endpoints.
⚡ 17. File System Errors
- Symptoms: Cannot write to local disk.
- Error Codes:
UnauthorizedAccessException,System.IO.IOException: Read-only file system. - Fix:
- Use
%HOME%\datafor temp files. - Store persistent data in Azure Storage.
- Use
⚡ 18. Quota & Plan Limits
- Symptoms: Functions throttled under heavy usage.
- Error Codes:
429 Too Many Requests,503 Service Unavailable,OutOfMemoryException. - Fix:
- Check Function App quota.
- Upgrade to Premium plan.
- Optimize memory usage and execution time.
⚡ 19. Disabled Functions
- Symptoms: Function never runs.
- Error Codes:
"disabled": trueinfunction.json| Portal shows disabled status. - Fix:
- Enable function in Azure Portal.
- Remove
"disabled": truefromfunction.json.
⚡ 20. Language Worker Errors
- Symptoms: Function crashes at startup.
- Error Codes:
LanguageWorkerProcess exited unexpectedly. - Fix:
- Ensure correct runtime version.
- Install latest extension bundle.
- Match Isolated vs In-Process worker correctly.
✅ Final Checklist for Debugging Function Apps
- Always check Application Insights first.
- Use Kudu console (
https://<app>.scm.azurewebsites.net) for logs. - Verify App Settings and Key Vault references.
- Confirm network access (VNet, firewall, DNS).
- Inspect error codes:
- AAD →
AADSTSxxxx - Storage →
403,404,409 - SQL →
10060(timeout) - Service Bus → DLQ,
MaxDeliveryCountExceeded - Functions runtime →
Error indexing method,LanguageWorker exited
- AAD →
- Scale up/out if hitting plan limits.
Comments
Post a Comment