在 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()
它似乎在我的本地电脑上工作,但在 azure 上,它不会引起任何问题,但什么也不做.
It seems to work on my local pc, but on azure, it doesn't raise any issues but does nothing.
我不能在 azure 上执行 .exe 文件吗?它是一个网络应用程序而不是云服务,我真的想避免网络/工作者角色,因为 .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,但有一些限制(没有明确记录).Process.Start 在 Azure 网站中
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屋!