I am using Azure App Service. I am trying to add several parameters in section Application settings -> App settings and Connection strings to override values from web.config
I cannot get access to these settings using ConfigurationManager. My project is based on .Net 4.6.
I can get access to these app settings and connection strings using Environment.GetEnvironmentVariable("name")
.
Also these settings are not visible on page https://.scm.azurewebsites.net/Env.cshtml in sections AppSettings and Connection Strings, only in section Environment variables
I read a lot of articles and haven't not found an answer.
Is it by design or I am doing something wrong?
Update 1 I created a test project in VS 2015 update 3 - Webforms App and it works, but it contains OWIN, by my project does not.
Update 2 Looks like I described my problem incorrectly. ConfigurationManager works, and I can access settings from web.config, but after deployment to Azure I am expecting that values will be substituted by values that I entered in Azure App Service -> Application settings -> App settings and Connection strings. But it does not happen.
My web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="APPINSIGHTS_INSTRUMENTATIONKEY" value="dummy" />
</appSettings>
<connectionStrings>
<add name="default" providerName="System.Data.SqlClient" connectionString="empty" />
<add name="ApolloTI" providerName="System.Data.SqlClient" connectionString="empty" />
<add name="TestData" providerName="System.Data.SqlClient" connectionString="empty" />
</connectionStrings>
...
</configuration>
Update 3 I just created an empty web project and it works, so looks like the problem is somewhere in my code or in project configuration.