Static non web python application on demand

Kacper Sobolewski 6 Reputation points
2022-09-23T11:17:09.367+00:00

Hello Community

I need an advice. Since last two weeks I'm trying to figure out, how to push to cloud python application managed only by command line.

Overview:

  1. Command line python application receiving few arguments and csv file with input data. This CVS file and execution command/request needs to be send by application outside of the cloud.
    eg. ./app.py ARG1, ARG2, ARG3, ARG4 --input_data data.csv
  2. Application is analyzing this data, and generates some files with results (txt files, images, etc) and exits.
  3. Results needs to be downloaded by 3rd party klient app.

ad1. Normally this python app is provided with our desktop application and it's execute on klient's computer. However for some reasons, we would like to push this part to the cloud and execute it on demand.

From my research, I'm afraid that this will not work. At least with actual architecture.

I was thinking about App Service, but this is designed for web apps, or containers, but from what I read in docs, they not accepting commands with arguments. Maybe docker, but is there a way to pass long command in to docker container, and write results to f.eg. Blob storage? Also regular VM would be some alternative but it generates constant cost, ewe if not used, and does can I pass command to it remotely?

Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-09-26T20:58:12.417+00:00

    KacperSobolewski-9509, Apologies for the delay from over the weekend.

    1/2:
    I understand, you have done enough research on this, weighing functionality to leverage for your specific requirement - Just to highlight, App Service uses the Gunicorn web server by default, which must be able to find your app object or wsgi.py folder. If needed, you can Customize the startup command.

    On App Service, you can control the container's startup behavior by providing either a custom startup command or multiple commands in a startup command file. A startup command file can use whatever name you choose, such as startup.sh, startup.cmd, startup.txt, and so on.

    Use a
    To use a different web server (non-Gunicorn server), such as aiohttp, use the appropriate command as the startup command or in the startup command file:
    python3.7 -m aiohttp.web -H localhost -P 8080 package.module:init_func

    You can run an unsupported version of Python by building your own container image instead. Use a custom Docker image.
    Production settings for Django apps


Your answer

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