question

JoeWhite-4463 avatar image
1 Vote"
JoeWhite-4463 asked KalyanChanumolu-MSFT answered

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

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
image.png (42.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
1 Vote"
KalyanChanumolu-MSFT answered

@JoeWhite-4463 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.


image.png (88.5 KiB)
image.png (43.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.