how can I make azure functions use settings in "local.settings.json" after deploying to azure

Joe White 116 Reputation points
2021-08-14T23:58:15.513+00:00

I've created an azure function using visual studio 2019 and added connection strings to "local.settings.json". It works locally when I debug but once I use VS 2019 publish feature, the function is deployed to azure but it tries to read from the azure function settings rather than "local.settings.json". Is there a way to keep it using "local.settings.json" or parse "local.settings.json" to the azure function host settings? Some automated way to deploy settings.

123315-image.png

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,425 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,316 Reputation points
    2021-08-15T16:50:19.167+00:00

    @Joe White Welcome to Microsoft Q&A Forums and thank you for your interest in Azure Functions.

    The publish experience within Visual Studio 2019 makes it easy for you to configure the settings during publishing itself.

    Click on Manage App Service settings

    123339-image.png

    Choose the setting(s) from local.settings.json that you would like to publish along with your app.
    AzureAppConfigurationEndPoint in this example

    123422-image.png

    You can choose to use the same value as in local.settings.json or specify a different value as per your environment you are publishing to.

    And Publish

    Since you are saving the settings to the publish profile, you don't have to repeat this every time you publish.

    Let us know if you have any further questions.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.

    2 people found this answer helpful.
    0 comments No comments