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

Added host.json when using UseAppSettings extension to be used by Azure Functions settings #7

Merged
merged 5 commits into from
Sep 8, 2020

Conversation

junalmeida
Copy link
Owner

No description provided.

@junalmeida junalmeida merged commit 49ed6d8 into master Sep 8, 2020
@junalmeida junalmeida deleted the add-hostjson branch September 8, 2020 17:03
Copy link

@LeastOne LeastOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change, I was on the prior version and got stuck with the host.json changes missing. Thanks also for maintaining this project, its the perfect Azure Functions DI solution IMO. I do have one question, is there a specific reason that the appsettings.json reference is optional: false instead of optional: true? I ask because a newly created Azure Functions project in Visual Studio doesn't include an appsettings.json file opting instead for local.settings.json. Consequently, in my case I'm forced to add an empty appsettings.json just to satisfy the optional: false requirement of UseAppSettings. Would it be possible to change the appsettings.json reference to optional: true?

@junalmeida
Copy link
Owner Author

Hello @LeastOne, I'm glad to see this project is working well for you. Fell free to open issues with suggestions or problems.
Answering your question, the UseAppSettings method is designed to make use of appsettings.json. If local.settings.json and hosts.json is enough for your project, you don't need to call UseAppSettings. This is not really required for the DI itself to work (to be honest this feature is not totally related to DI itself).

So since, the call to UseAppSettings is optional, I see no point on calling it when you have no appsettings file.

Let me know if I could be missing any important detail in a common use case.

@LeastOne
Copy link

@junalmeida, thanks for the response. I think your response / perspective is certainly logical. However, in my instance I was planning on using the appsettings.json file locally but then excluding it from deployment, which I believe to be a valid use case. Without said feature I decided to instead include the appsettings.json file in my deployment which contains basic default non-secret values that end-up getting replaced by the Azure host app-setting environment variables. Anyway, just passing this feedback along as food for thought. Very thankful for your solution as a part of my project.

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

Successfully merging this pull request may close these issues.

2 participants