Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Subfolders #1240

Open
iyerusad opened this issue Jun 5, 2019 · 12 comments
Open

Feature: Subfolders #1240

iyerusad opened this issue Jun 5, 2019 · 12 comments
Labels

Comments

@iyerusad
Copy link

iyerusad commented Jun 5, 2019

Feature: Support subfolders / categories structure.

Mockup:

http://localhost:7071/api/promos
http://localhost:7071/api/promos/list
http://localhost:7071/api/promos/newest
promos/
├── function.json
├── index.js
├── list
│   ├── function.json
│   └── index.js
└── newest
    ├── function.json
    └── index.js

Existing workarounds are rather janky:

  • Create custom proxy paths mapping
    • Manual, One by one, and hardcoded
    • Folder structure is still all in root (since function.json can't be moved)
    • "Standard Functions billing applies to proxy executions." (ref)
  • Use Configure Script entry point
    • Manual, One by one, and hardcoded
    • Folder structure is still all in root (since function.json can't be moved)

Stackoverflow request: https://stackoverflow.com/questions/44176892/azure-functions-in-sub-folders

@mhoeger
Copy link

mhoeger commented Jun 6, 2019

cc: @ColbyTresness

@orta
Copy link

orta commented Oct 3, 2020

I ended up building multiple function apps to effectively replicate this, but now that I'm a bit further down the line - I'm probably going to move to flatten the apps into a single one and use prefixes on the names instead.

@MattL-NZ
Copy link

MattL-NZ commented Nov 2, 2020

Hey @mhoeger, @ColbyTresness, can anyone confirm if this is being looked at? I would love the ability to move my typescript functions into a subfolder to make the layout a lot cleaner.

@vohrahul
Copy link

Upvote, this is definitely going to be very interesting to have this. Currently using the prefixes on the names.

@Krucial92
Copy link

Upvote! If we could specify a folder in host.json for example "./src/functions" which could recursively look for our function.json files in that folder that would be amazing, as opposed to having 50 functions in the root folder along with everything else.

Any update here, is this on the roadmap? @mhoeger @ColbyTresness

@afefer
Copy link

afefer commented Feb 24, 2021

This would be super valuable. My function app's starting to get out of hand with no way to organize them. Being able to group functions in subfolders would go a long way! @mhoeger any idea if this is being looked at?

@LotfiMEZIANI
Copy link

There is some news about this feature?

@mogupta-ecfmg
Copy link

upvote.. this feature is very much needed when working with multiple functions inside the same project.. its very difficult to manage the code otherwise.. I believe AWS already provides this feature !

@flo-sch
Copy link

flo-sch commented Sep 21, 2021

That would make things so much simpler when working in an https://nx.dev/ workspace/monorepository, really hope this can get prioritized 🙏

@LotfiMEZIANI
Copy link

That would make things so much simpler when working in an https://nx.dev/ workspace/monorepository, really hope this can get prioritized 🙏

Can we develop an azure function project in nx?

I had searched last year, but there was no nx plugin for.

@flo-sch
Copy link

flo-sch commented Oct 4, 2021

Can we develop an azure function project in nx?

There is no official plug-in but I currently manage to maintain one Function App as a nx workspace thanks to the "scriptFile" option of AF to target nx dist folder, as described here: https://github.com/Azure/azure-functions-core-tools/issues/2736
(Inspired from the TS template of Azure Functions)

It uses nx to compile and serve, and Azure Functions Core Tools (AFCT) to run locally and deploy.
And since AFCT does not recommend to update only one function, the deployment publishes all functions, which means no optimized CD for that step (... but other nx targets can work with the affected scope, for instance if you also have frontend projects in the workspace)

@ChuckJonas
Copy link

even just being able to drop all the functions in a subfolder 1 level deep would make a big difference. That way at least you have single folder containing ONLY functions.

 functions
    - petstore-get
    - petstore-post
    - foobar-get
 lib
    - validators.ts
packet.json

Right now, I have function folders sandwiching lib and root level configuration files, which seems really disorganized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests