Deployment to slot stops working with 503 error

Petri Lipponen 0 Reputation points
2025-10-08T05:42:11.3666667+00:00

Function app with python 3.11 that has worked more or less fine until two days ago.

First the deployment to staging slot, while succeeding, did not replace the code (no new functions, old ones worked the old way). This despite repeated restart, stop & start, refresh etc. which has usually fixed it in a few minutes.

Then after checking all kinds of things, the azure services (api/deployments/latest, deployment via vscode, deployment with “az functionapps deployment” etc.) started to give error 503 and now nothing can be done. Curiously the azure portal tells that everything is fine, and the (still old) function app still responds.

The deployment url "....scm.azurewebsites.net/api/deployments/latest" also gives 503

**
Yesterday:** I deleted the staging slot and re-created. After that, the deployment worked again and I was able to continue development, but only for a few hours. After half a day, the deployment started to give 503 again and hasn't recovered since.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 18,310 Reputation points Volunteer Moderator
    2025-10-08T06:50:29.3033333+00:00

    Hi Petri Lipponen,

    that 503 error on deployment while the function app itself keeps running is super frustrating )) especially when it comes and goes unpredictably like you're experiencing. This usually points to issues with the underlying app service platform rather than your code.

    The 503 on the scm.azurewebsites.net endpoint suggests the Kudu deployment engine is having problems. This could be due to platform updates, resource constraints, or backend service issues in your region.

    Check the function app's platform settings. Make sure you're running on the same platform (32-bit vs 64-bit) as before, and verify the Python version is still correctly set to 3.11. Sometimes platform updates can reset these settings.

    Try scaling your function app plan up temporarily, then back down. If you're on a consumption plan, switch to a premium or dedicated plan briefly, then switch back. This can sometimes reset the underlying compute instances and clear deployment issues.

    The Azure Functions troubleshooting guide has specific steps for deployment issues https://free.blessedness.top/en-us/azure/azure-functions/functions-recover-storage-account.

    Also check your application settings, particularly any WEBSITE_* settings. Sometimes corrupted application settings can cause deployment failures even though the runtime continues working.

    Another approach is to use the Run From Package deployment method instead of direct code deployment. This involves deploying your function as a zip package to blob storage and having the function app load from there. It's often more reliable than direct file deployment.

    You can also try deploying to a completely new function app in a different region. If that works, it suggests there might be a regional platform issue affecting your original function app.

    If you're using deployment slots, try deploying directly to the production slot temporarily to see if the issue is slot-specific or affects the entire function app.

    For immediate debugging, check the function app's log stream while attempting deployment. Even though the deployment fails, you might see error messages in the logs that give clues about what's failing in the backend.

    Hope this helps you get deployments working again

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.