Return HostStartSettings if local.settings.json is not loaded #4629
+8
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
resolves #4604
Pull request checklist
release_notes.md
Additional information
This is an unfortunate overlap with how the help command is designed today, and how the start action's args use customer options.
Unfortunately the way that the help action is designed today makes it so that we need to load an action to get it's arguements/options. So in a situation like this where you run
func
to see the commands, we run the StartAction.ParseArgs -> which inits the secret manager to get host options (if any) -> secret manager looks for local.settings.json -> that doesn't exist outside of a func app dir -> exception.This will all be reworked as part of our upcoming refactor, which will seperate these two things and cleanup the help command in general.
Updated
GetHostStartSettings
to catch the exception when local.settings.json does not exist and return a newHostStartSettings
. If a customer configures these settings, then local.settings.json and/or host.json will exist and the exception won't occur. If a customer does not configure these settings, we use the default.