Azure函数调用本机C ++ [英] Azure functions calling onto native C++

查看:79
本文介绍了Azure函数调用本机C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Azure中设计一个新的体系结构.它是一个多租户SaaS应用程序,具有ASP.NET MVC前端和Blob存储中的一些特定于应用程序的数据.我需要在某些时候对此应用程序数据执行一些后台处理.目前,只有使用某些旧版C ++代码才能做到这一点(我实际上无法用C#重写它).

I'm designing a new architecture in Azure. It's a multi-tenant SaaS application with an ASP.NET MVC front end and some application specific data in blob storage. I need to perform some background processing on this application data at certain points. This is currently only possible using some legacy C++ code (I can't realistically rewrite this in C#).

我曾经想到的是将任何后台作业推送到队列上,并在将作业推送到队列时使用Azure函数为队列提供服务.症结是本机代码.我当然可以在本机代码中公开C#可以p/调用的方法,但是Azure函数可以调用本机DLL,如果是这样,这是一种明智的方法吗?

One thought I had was to push any background jobs onto a queue and use Azure functions to service the queue as and when a job gets pushed onto it. The sticking point is the native code. I can certainly expose methods in the native code that C# can p/invoke, but can Azure functions call onto native DLLs and if so is this a sensible approach?

推荐答案

该代码确实在沙箱中运行,但是这种方法应该可行. (您可能要考虑将相关的API公开在托管程序集中,然后由您的函数使用).

The code does run in a sandbox, but this approach should work. (you may want to consider exposing the relevant API in a managed assembly that would in turn be consumed by your function).

是否会遇到沙箱的限制取决于代码在做什么,但是您可以在此处了解有关沙箱及其限制的更多信息:

Whether you'll run into limitations with the sandbox is dependent on what your code is doing, but you can learn more about the sandbox and its restrictions here: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox

我希望这会有所帮助!

这篇关于Azure函数调用本机C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆