CloudConfigurationManager.GetSetting doesn’t retrieve settings from the section of app.config. Instead, it pulls values from the section or from Azure configuration sources, such as the Azure portal or environment variables.
To fix this, you have two options:
Update your app.config to use the section like this:
<configuration> <appSettings> <add key="StorageConnectionString" value="[ConnectionStringHere]" /> </appSettings> </configuration>
Now, CloudConfigurationManager.GetSetting(“StorageConnectionString”) will return the connection string correctly.
Alternatively, you can read the connection string directly from the
var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[“StorageConnectionString”].ConnectionString;
This will allow us to keep the connection string in the
var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString;
This will allow us to keep the connection string in the