Azure Functions - 跨函数应用共享代码 [英] Azure Functions - Shared code across Function Apps

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

问题描述

有没有办法在 Azure 中的两个不同功能应用之间共享通用代码?

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

我知道可以像这样在同一个 Function App 下的两个函数之间共享代码:

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

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

但我想在两个不同的函数之间共享日志记录代码,每个函数都在它自己的函数应用程序下.功能在两个不同的功能应用下的原因是我需要一个在消费计划上运行,另一个在应用服务计划上运行,除非有另一种方法吗?

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 中没有直接的跨应用程序边界共享代码的方法,这对于函数应用程序和 Web 应用程序都是如此.您需要将相关代码部署到每个需要它的应用程序中.

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天全站免登陆