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.
Most of the time, you open EXE files directly by double-clicking them in Windows. To begin, click Start and select the "Search" function. When you type the name of the EXE file you want to open, Windows displays a list of the files it finds. Double-click on the EXE filename to open it.
So you really can't launch .exe files from a browser with any much success - it simply a security hole the size of open barn door. You might get some success opening up some trusted locations for the browser - but it is a difficult challenge at best.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With