0

We have two different azure function app projects, each with a single function. We would like to host them all under a single Function App in Azure and each with it's own bin. I would like to be able for each function to deal with their own versions of external references, i.e. function1 might use json.net 10.0, while function2 stay on json.net 9.0.

Creating an Azure Function App host for each function can become very unmanageable, specially if we have to multiply x3 for each environment: dev, staging, prod.

We tried by doing a normal deployment of the two projects, but they both share the same bin (which resulted in a reference issue):

wwwroot
- bin
- function1
--- function.json (pointing to ../bin/function1.dll)
- function2
--- function.json (pointing to ../bin/function2.dll)
- host.json

We also tried creating virtual application directories and deploy to those, but the portal doesn't find the functions. The end structure is:

wwwroot
- function1
--- bin
--- function1
------ function.json
--- host.json
- function2
--- bin
--- function2
------ function.json
--- host.json

moving the function.json file of each function to the root of the virtual directory and fixing the reference to the dll fixes the issue.

It sounds like Virtual Directories would cater to this need, but the portal doesn't seem to support finding function.json two levels deep.

Is what we are wanting to do possible?

2 Answers 2

0

There is no process isolation between functions in the same Function App: they all run in the same process and in the same App Domain.

If you need complete isolation, the only way to achieve that is by having the functions in separate Function Apps.

I guess the solution is to automate Function App management to the acceptable level.

3
  • Why isn't there process isolation some other ways, I demonstrated you can isolate them using Virtual Directories, why not support this scenario? Dec 8, 2017 at 0:28
  • Do you see anything wrong with my manual approach of Virtual Directories and moving files? Dec 8, 2017 at 0:44
  • @JonasStawski I'm not a designer of Functions, so I can't answer "why not support". Just saying your approach won't work. Dec 8, 2017 at 6:51
0

This documentation seems to imply that you can define custom assemblies on a per function basis, though I do not know how the versioning would work.

Private assemblies are part of a given function's context, and support side-loading of different versions. Private assemblies should be uploaded in a bin folder in the function directory. Reference using the file name, such as #r "MyAssembly.dll".

1
  • We are using .NET Class Libraries Dec 8, 2017 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.