Skip to content

Azure function(javascript) - read local.settings.json property during testing #475

Answered by ejizba
jason-mwnz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jason-mwnz the "local.settings.json" file is only used when running locally with the func core tools cli. For any other scenario, including unit tests, it will not be used. One reason is that the file should not be tracked in git because it may contain secrets, meaning it will not be useable in CI. If you can describe how you run your tests locally (from VS Code, the CLI) and/or from CI (Azure Pipelines, GitHub Actions, etc.) I might be able to help give a solution

We have #120 to track better docs on testing practices and otherwise I thought I'd try converting this to a "discussion" (never tried this before) since there won't be any action item on our side

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@jason-mwnz
Comment options

@ejizba
Comment options

@jason-mwnz
Comment options

@ejizba
Comment options

Answer selected by jason-mwnz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #471 on November 22, 2021 19:19.