Azure-functions-core-tools: Confusion over app.settings.json

Created on 15 Aug 2017  路  4Comments  路  Source: Azure/azure-functions-core-tools

local.settings.json is documented as only being used locally, and there's a clue in the name ;)

However there is also the fetch-app settings verb and --publish-local-settings option. Plus, the docs say "Use the --publish-local-settings switch when you publish to make sure these settings are added to the function app in Azure."

Why would you publish the local settings to Azure if it's not used there?

Perhaps this is just a convenience to store it so it can be retrieved for other local setups? That could be useful as you wouldn't want to check it in to VC (even though there is an encrypt option). However in a CI situation you'd never use the FunctionApp as a store of important data. You just publish to it.

Adding to the confusion, is the fact that if I download the app content for the FunctionApp via the portal there is an option to "Include app settings" which then gives a local.settings.json.

In fact I get 2 of them in the zip which seems odd given the same filename. One is as I've uploaded localsettings.json and I guess teh otehr is a badly named file generatad from the azure app settings.

If I look at this file it's content is different and does appear to be the azure App settings. I see it has a Value key rather than values.

Most helpful comment

So I think I have resolve the confused caused by names and various bits of documentation

  • Azure App Settings are stores in a database for each Function App / Web App
  • Run time access these as environment variables.
  • They can be manually viewed and updated / added in the portal (but LF cannot be entered)
  • Remote programmatic access to the App Settings is mediated by Azure through specific APIs
  • A local.settings.json file containing the settings can be downloaded from the portal with the app content

    • The file name is a tad confusing

    • There is a bug in the main key "Values"; it is "Value"

  • There appears to be no way in the portal to upload a file into the App Settings
  • The AzureFunctions CLI can send the local.settings.json contents to Applications Settings as part of a App upload. The file itself is NOT uploaded. If you do upload the file it will be ignored.
  • The App settings can be fetched via the AzureFunctions CLI
    *There is no fully programmatic way to upload the App Settings as AzureFunctions CLI will involve some interactive login and require fairly non deterministic state setting of the Subscription and needs to be in the correct directory when run.

Is that correct? Have I missed something? I hope this helps others

All 4 comments

So I think I have resolve the confused caused by names and various bits of documentation

  • Azure App Settings are stores in a database for each Function App / Web App
  • Run time access these as environment variables.
  • They can be manually viewed and updated / added in the portal (but LF cannot be entered)
  • Remote programmatic access to the App Settings is mediated by Azure through specific APIs
  • A local.settings.json file containing the settings can be downloaded from the portal with the app content

    • The file name is a tad confusing

    • There is a bug in the main key "Values"; it is "Value"

  • There appears to be no way in the portal to upload a file into the App Settings
  • The AzureFunctions CLI can send the local.settings.json contents to Applications Settings as part of a App upload. The file itself is NOT uploaded. If you do upload the file it will be ignored.
  • The App settings can be fetched via the AzureFunctions CLI
    *There is no fully programmatic way to upload the App Settings as AzureFunctions CLI will involve some interactive login and require fairly non deterministic state setting of the Subscription and needs to be in the correct directory when run.

Is that correct? Have I missed something? I hope this helps others

@SteveALee Is your blog down?

@VictorioBerra Yes, I let the domain slip. However I archived it to static pages here - https://opendirective.net/azureserverless/

I edited the previous comment to link to the archive

Was this page helpful?
0 / 5 - 0 ratings