Unable to retrieve configuration setting values from azure Service configuration file

393 views Asked by At

I am unable to retrieve configuration setting values from Azure service configuration file.

I am able to run the application in local machine but after uploading the package into the azure site. Then while browing the application it is throwing the error. I tried to read the values in the below two ways.

public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(CloudConfigurationManager.GetSetting("ConnectionString"));

and

public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));

It is throwing an error that

Exception Occurred ::The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception"

Please help me in resolving this error.

0

There are 0 answers