问题
I have a flask web app that is published on azure. In my project I have a 'senna-win32.exe' that takes in input and sends out some output. My code for calling this .exe looks like this:
senna_path = 'senna-win32.exe'
p = subprocess.Popen(senna_path,stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = p.communicate(input=bytes(userInput, 'utf-8'))[0]
inList = stdout.decode()
It seems to work on my local pc, but on azure, it doesn't raise any issues but does nothing.
Can I not execute .exe file on azure? It is a web app and not a cloud service, I'm really trying to avoid the web/worker roles since .exe doesn't do whole lot of processing.
回答1:
As ajbeaver mentioned, you can start exes in an azure web app but there are some restrictions (not clearly documented). Process.Start in Azure Website
I'd enable application logging and also see if you can capture the stderr from your exe and write that to the diagnostic log. https://docs.microsoft.com/en-us/azure/app-service/web-sites-enable-diagnostic-log
来源:https://stackoverflow.com/questions/41841339/running-exe-on-azure