Azure Functions-跨功能应用程序共享代码 [英] Azure Functions - Shared code across Function Apps

查看:64
本文介绍了Azure Functions-跨功能应用程序共享代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Azure中的两个不同的功能应用程序之间共享通用代码?

Is there a way of sharing common code across two different Function Apps in Azure?

我知道可以在同一个功能应用程序下的两个功能之间共享代码,如下所示:

I understand it is possible to share code between two functions under the same Function App like so:

#load "../Shared/ServiceLogger.csx"

但是我想在两个不同的函数之间共享日志记录代码,每个函数都在其自己的Function App下.这些功能位于两个不同的Function App下的原因是,除非有另一种方法,我需要一个在Consumption计划上运行,另一个在App Service计划上运行?

but I would like to share logging code between two different functions, each under it's own Function App. The reason for the functions being under two different Function Apps is that I need one to run on the Consumption plan and the other run on an App Service plan, unless there is another way of doing this?

推荐答案

在Azure App Sercice中没有跨应用程序边界共享代码的直接方法,这对于Function Apps和Web Apps均适用.您将需要将相关代码部署到需要它的每个应用程序中.

There is no straightforward way to share code across app boundary in Azure App Sercice, and this holds true both for Function Apps and Web Apps. You will need to deploy the relevant code into each app that needs it.

这篇关于Azure Functions-跨功能应用程序共享代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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