Skip to content

func pack requirs local.settings.json #4783

@runegulbrandsen

Description

@runegulbrandsen

Version

4.6.0

Description

I was trying to create a CI build for my Nodejs Azure Function, but got errors all the time when running func pack --no-build command with the following error:

'local.settings.json' found in root directory (/<projectpath>).
'local.settings.json' found in root directory (/<projectpath>).
The value cannot be an empty string. (Parameter 'path')

I changed the command to func pack . --no-build, then the error changed to (since GitHub CoPilot advised this) and then the error switched to:

'local.settings.json' found in root directory (/<projectpath>).
'local.settings.json' found in root directory (/<projectpath>).
Unsupported runtime: None

I diffed the files locally and on the CI build and the only difference was that the local.settings.json was the difference. I added this and then suddenly everything worked.

The project was created using func new and the exclusion of local.settings.json is done by the default creation, so the question is: Is the problem that func new excludes files that are required, or is the problem that func pack depends on file that it shouldn't?

Steps to reproduce

  1. Create a project using func new, use Node and Typescript.
  2. Commit the project into a git repo.
  3. Install node packages with npm install
  4. Build the project running npm run build
  5. Trim packages using npm ci --omit=dev
  6. Clone the git repo into a new folder and try tu run func pack --no-build and func pack . --no-build.You will get the errors as described above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions