azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Document --prefix and --script-root as cli options that are available to use from func start

Open cristobal opened this issue 2 years ago • 5 comments

Background

We are currently working on a TypeScript project where our code is laid out as following:

src/
  FunctionOne/
  - function.json
  - index.ts
  FunctionTwo/ 
   - function.json
   - index.ts
 - host.json
 - shared/*
 - ...

And the corresponding output from the tsc compiler:

src/
  FunctionOne/
  - function.json
  - index.js
  FunctionTwo/ 
   - function.json
   - index.js
 - host.json
 - shared/*
 - ...

However to get this approach working we had to navigate trough several issues and comments on this topic. And to make our code work locally we had to prefix the func start with --prefix dist or otherwise we could also use --script-root dist, but it seems that using --prefix is the best option. These options have been available for a while but they are not documented and neither available from the CLI options for the func start command.

  • https://github.com/Azure/azure-functions-core-tools/issues/858
  • https://github.com/Azure/azure-functions-core-tools/commit/50323beaaef1ad61dd0d4c13d7fe606d7cfec51c

Proposal

If these options are meant to be used it would be nice to have them documented or at least available from the CLI. I am open for making a contribution / PR, but would like your input on the topic first…

cristobal avatar Jan 04 '22 13:01 cristobal

I think --prefix and --script-root might be equivalent. Makes sense to add it to the command help. @michaelpeng36 please let @cristobal know if this is something they can contribute to.

+ @ggailey777 to see if docs should be updated as well.

anthonychu avatar Jan 17 '22 22:01 anthonychu

@cristobal Thanks for pointing this out! Yes, if you could add the documentation for both --prefix and --script-root in a PR, that would be fantastic.

michaelpeng36 avatar Jan 24 '22 23:01 michaelpeng36

@cristobal Thanks for pointing this out! Yes, if you could add the documentation for both --prefix and --script-root in a PR, that would be fantastic.

Aight will look into it this week, sorry did not see this reply before now. Been a bit busy at work and drown in Github messages at work need to sort out the notifications here somehow 😂

cristobal avatar Mar 21 '22 20:03 cristobal

Hello @cristobal, do u have some updates? Thx!

andriimazur93 avatar Jul 12 '22 13:07 andriimazur93

@andriimazur93 sorry been quite busy at work lately, i have some time off now. But will look into it and fix it next week. thanks for reminding me of this 👌👍

cristobal avatar Jul 12 '22 14:07 cristobal