Friday Fact: Settings present on local.settings.json file inside Azure Functions project are not deployed with Visual Studio

  • Luis Rigueira
  • Jan 19, 2024
  • 2 min read

When creating an Azure Function, it’s crucial for security reasons to avoid directly embedding connection strings and other sensitive information in the code.

In our development environment, a common best practice is to store such important information in the local.settings.json file:

This image has an empty alt attribute; its file name is Screenshot_1563.png

Of course, we can improve further by binding Key Vault as well. If your local tests go as expected and the code is correct, the next step is to deploy it to your Azure Subscription. This brings us to today’s Friday Fact!

📝 One-Minute Brief

Settings defined in the local.settings.json file are only used during local development and are not deployed when publishing Azure Functions from Visual Studio. This Friday Fact explains the behavior and highlights how to correctly configure application settings after deployment.p>

After you upload the Azure Function to the Azure Portal and try to use it in a Logic App, you may notice differences between local tests and the runtime environment. The issue is not the Logic App integration itself. Instead, the problem comes from missing configuration values.

Here’s the key detail: Visual Studio does not deploy the local.settings.json file during manual deployments. As a result, connection strings and other critical settings do not move to Azure. After deployment, you must configure these values directly in the Function App and ensure they match the key‑value pairs defined locally. If you use CI/CD pipelines, you can automate this step easily.

Once you complete this configuration, the Azure Function and the Logic App flow should run as expected. Always keep this behavior in mind. Ignoring it often leads to failed executions and unnecessary troubleshooting after deployment.

Environment Variables

This is the key spot to enter the necessary details, ensuring seamless operation of your Azure Function. By managing these environment variables effectively, you’ll have your Azure Function up and running.

Hope you have enjoyed this Friday Fact, and we will see you in the next one!

To lazy to read? We’ve got you covered! Check out our video version of this content!

Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can help us buy a Star Wars Lego for Sandro’s son! 

Author: Luis Rigueira

Luis Rigueira is a Enterprise Integration Consultant at DevScope

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top