In this blog, we will learn how to configure and use Environment Variable in Azure Function. Concept of using Environment variable during your development which needs to deploy on multiple servers and connect to multiple systems. Whenever you use Environment variables to store the global constant or system credentials it reduces the time which was required to modify the code base for multiple deployments.

Let’s get started with Creating the Azure Function and using the Environment variable.

Step 1: Create an Azure Function inside the Visual Studio:

I have created the HTTP Trigger Azure function inside Visual Studio and the authorization level is Anonymous

Once you create an Azure Function project you will notice there are many files created with the project. We have a “local.setting.json” file that we are going to use and it holds the environment variable while the development and testing phase of your Azure function.

Step 2: Declare credentials/global variable inside “local.setting.json”

--

--

Amit Prajapati

I am Technical Consultant from Mumbai, India. I like to contribute my knowledge to the community and good social cause.