在Azure上运行.exe [英] Running .exe on Azure
问题描述
我有一个在azure上发布的flask Web应用程序.在我的项目中,我有一个'senna-win32.exe',它接受输入并发送一些输出.我用于调用此.exe的代码如下:
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()
它似乎可以在我的本地PC上运行,但是在天蓝色下,它不会引发任何问题,但是什么也不做.
It seems to work on my local pc, but on azure, it doesn't raise any issues but does nothing.
我不能在Azure上执行.exe文件吗?这是一个Web应用程序,而不是云服务,我真的想避免使用Web/Worker角色,因为.exe不会进行大量处理.
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.
推荐答案
正如ajbeaver所述,您可以在azure Web应用程序中启动exe,但是存在一些限制(未明确记录). 在Azure网站上启动Process.a
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
我将启用应用程序日志记录,并查看是否可以从exe捕获stderr并将其写入诊断日志. https://docs.microsoft. com/en-us/azure/app-service/web-sites-enable-diagnostic-log
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
这篇关于在Azure上运行.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!