Azure App Service using a Windows container Failing and restarting - Modify Compute System failed

tlcs 26 Reputation points
2020-04-21T10:38:10.437+00:00

Hey all,

This question has been asked before, but the answer didn't seem to work for me. I've set up a simple hello_world (Python, Flask) windows container with the following image:

mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019

Unfortunately every time I try to start it up I get the following:

21/04/2020 09:54:59.213 INFO - Site: - Start container succeeded. Container: xxx
21/04/2020 09:55:02.268 INFO - Site: - Attempting to stop container: xxx
21/04/2020 09:55:03.126 INFO - Site: - Container stopped successfully. Container Id: xxx
21/04/2020 09:55:03.126 INFO - Site: - Purging pending logs after stopping container
21/04/2020 09:55:03.158 INFO - Site: - Purging after container failed to start
21/04/2020 09:55:03.158 ERROR - Site: - Unable to start container. Error message: Modify Compute System failed.

The container works great local, but once its in the app service it won't start. I tried running it with different windows images but no luck. Anybody have some advice?

Kind regards,

tlcs

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
{count} vote

Accepted answer
  1. Ryan Hill 26,146 Reputation points Microsoft Employee
    2020-05-01T22:53:13.98+00:00

    @tlcs took long enough but I got a docker image that works. For background, Windows Container images are still a preview feature and more than likely the cause of the issue. The python base image I got working is one based on the cached instances Azure has right now. I'm no docker expert but I think

    FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
    FROM python:3.8

    was causing an issue. See my docker image below. I did verify this works on both Windows and Linux app service plans so enjoy. Hope this helps get your unblocked.

    7886-2020-05-01-18-33-53-dockerfile-hello-flask-visual.png

    FROM python:3.8-windowsservercore-1809  
    COPY . /app  
    WORKDIR /app  
    RUN pip install -r /app/requirements.txt  
    EXPOSE 5000  
    CMD ["python", "app.py"]  
    

    app.py

    from flask import Flask  
    app = Flask(__name__)  
      
    @app.route("/")  
    def home():  
        return "Hello, Flask!"  
      
    if __name__ == "__main__":  
        app.run(debug=True,host='0.0.0.0')  
    

0 additional answers

Sort by: Most helpful