Azure / Azure/azure-functions-powershell-worker

When running locally, create the ManagedDependencies folder under the app folder instead of %LocalAppData%

Open
#574 0 comments 0 reactions 1 assignee Claimed by @Francisco-Gamino View on GitHub
feature:managed dependencies investigation P2
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

When running Functions locally, managed dependencies are automatically installed into `%LocalAppData%\AzureFunctions\\ManagedDependencies`. One problem is that this location is not easily discoverable. As a result, the user who runs multiple apps locally ends up having many instances of potentially duplicated modules installed, without being aware of that. Furthermore, removing the app folder or running `git clean` in the app folder does not remove the extra content. We can significantly improve this situation by creating a local ManagedDependencies folder under the app folder and including this folder into .gitignore and .funcignore.

This proposal is somewhat related to #203: it addresses a similar concern, but in a different way. This proposal does not _automatically_ eliminate module content duplication. Instead, _it gives the user more direct and intuitive control_: removing the app folder or running `git clean` gets rid of the extra content. At the same time, it maintains proper app isolation and does not require a shared module repository (which can be quite challenging to design and maintain, definitely more difficult than just moving the ManagedDependencies folder).

One challenge here is that creating/modifying files under the app folder leads to the Functions Host restarting the worker. This can be addressed by discovering or introducing exceptions from this rule. For example, when running on Windows, creating/modifying files under a _hidden_ folder does not currently trigger worker restart. We may be able to find a similar trick on Linux. In the worst case, we can come up with a reasonable naming convention (e.g. ignore folders with names starting with a dot, or even hardcoding `ManagedDependencies` as a reserved name).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.