Can I use an appsettings.json file in Azure Functions?

0 votes

I had a doubt if I can use an appsettings.json file in Azure Functions? I referred to this documentation for environment variables: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp#environment-variables

But I am using Octopus for deployments and would really like to have appsettings version controlled.

I have tried this:

{
  "frameworks": {
    "net46": {
      "dependencies": {
        "Microsoft.Extensions.Configuration": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0"
      }
    }
  }
}

But I'm getting the following error:

2016-11-23T15:27:03.811 (12,16): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0

Kindly help.

Apr 24 in Azure by sabby
• 4,370 points
929 views

1 answer to this question.

0 votes

Only environment variables are supported for app settings and connection strings. appsettings.json is not supported.

However, you can use Azure Resource Manager (ARM) Templates to configure the settings for your Function App. Here's a blog post that describe this in more detail.

answered Apr 24 by Prerna
• 1,940 points

Related Questions In Azure

0 votes
1 answer

How can I remove/hide/disable excessive HTTP response headers in Azure/IIS7 without having to use UrlScan?

MSDN published an article on how to ...READ MORE

answered May 21, 2018 in Azure by club_seesharp
• 3,450 points
643 views
0 votes
1 answer

How can I use “Azure File Storage” with Web App Service?

If you're looking for mapping a drive ...READ MORE

answered Aug 10, 2018 in Azure by null_void
• 3,220 points
1,447 views
0 votes
2 answers

Can I Login without prompt in Azure?

You can use -Credential parameter, and DPAPI to login. First, ...READ MORE

answered Aug 17, 2018 in Azure by Priyaj
• 56,960 points
1,663 views
0 votes
1 answer

How can I replicate an Azure Virtual Machine?

To create a managed image of a ...READ MORE

answered May 23, 2018 in Azure by club_seesharp
• 3,450 points
66 views
0 votes
1 answer

Which cloud hosting is best ( AWS or Azure or Google)

Hello @Hammer, This totally depends on your needs, ...READ MORE

answered Aug 10, 2018 in AWS by Priyaj
• 56,960 points
75 views
+14 votes
23 answers

AWS vs Azure which one will have a more promising career?

Azure is integrating with a lot of ...READ MORE

answered Jul 4, 2018 in Career Counselling by Soumodip Sinha
2,044 views
0 votes
1 answer

Azure has 3 different types of storage accounts. Is there any major difference between them?

Azure Storage provides three types of storage ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
669 views
0 votes
1 answer

How to check if multiple files exist in Azure container?

foreach loop is the most efficient way though. ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
311 views
0 votes
1 answer
0 votes
1 answer

Can I use .NET's HttpClient to hit an Azure Mobile service?

Yes, you can do this by adding ...READ MORE

answered Apr 15 in Azure by Prerna
• 1,940 points
145 views