Hello Demestris Gerogiannis. Welcome to the Microsoft Q&A Community!
I see you are encountering issues while deployment your Azure Function App.
Since you have tried the same deploymente before and it worked perfeclty, a 503 Service Unavailable error happens due to:
- The function host being down or restarting.
- Backend server issues (like the platform not running or resources not being allocated).
- Memory leaks or code issues causing the backend server to fail.
To troubleshoot host-related problems, check the "Diagnose and solve problems" section in the Azure Portal under the Function app. Use the "Function app down or reporting" detector to view detailed diagnostics about the app and infrastructure.
Another common cause of 503 errors is when a function takes too long to respond. In the Consumption Plan, an HTTP-triggered function has a hard limit of 230 seconds to return a response, no matter what timeout setting you configure. If you need longer processing, consider using Azure Durable Functions with an async pattern.
Best Practices to Avoid 503 Errors:
- Avoid frequent app settings changes in production. Every time you update app settings, the app restarts, which can cause 503 errors. Use deployment slots to manage changes safely.
- Check for issues in
host.json
. An invalidhost.json
can cause the function host not to run. Use the log stream in Azure Portal to review host logs and debug.
Common Issues and Fixes:
- If you're using a
Startup.cs
class, check Application Insights for any logged errors. - Missing app settings can cause failures. Make sure you publish your local settings during deployment.
- If none of these help, it could be a platform issue. You’ll need to check backend logs to see what was happening at the time of the 503 errors.
If this helped, mark it as the accepted answer so others can solve their issue too!