
Well, here we will discuss the Azure Function Folder Structure. You should understand it before you start creating Azure Functions.
Table of Contents
Azure Function Folder Structure
Once, you will create an Azure Function Project using Visual Studio 2019, You will get the below Azure Function Project Structure.

If you will click on the Project name i.e. TestAzureFunction in my case, that is the .csproj file that contains all the configurations for your Azure Function project. This file contains the code below
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.36" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
Dependencies contain all the packages(DLLs) and SDKs needed for your Azure Function Project. You will expand that you can able to see many dlls that are referred to your Azure Function Project. Below are a few of them
Microsoft.NET.Sdk.Functions
Microsoft.Azure.Webjobs
NewtonSoft.json
Function1.cs file is the main class file that contains the Azure Function code. If you want to modify the Azure Function logic based on your business requirement then you need to modify the Azure function code in this file.
The file will look like below

The next file is the host.json file contains all the settings or configuration options that affect all the Azure functions within that Azure Function App. If you want to apply any configuration property changes then this is the file where you will have to change.
The default host.json file contains the below code
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
Next, coming to the local.settings.json file, you can keep the application settings value that we get from the Azure Portal. It contains the configurations below
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
One important thing to note down here is, local.settings.json file changes are for local use only, you can consider them for development purposes only. Once you will deploy the Azure Function to Azure. You will not get the reference for this file. This is very important to remember.
If you are referring to any of the application settings from the local.settings.json file then Once you will deploy the Azure Function to the Azure Portal, Make sure to do the same application settings changes manually in the Azure Portal since you will not get the reference of this file in Azure or else your Azure Function will not work properly.
Final Thoughts
In this Azure article, we discussed Azure Function Folder Structure. Thanks for reading this article !!!