3

I have an Azure Worker Role (WR) which is supposed to pick up it's config from the .cscfg files using:

var setting = CloudConfigurationManager.GetSetting("My.Setting.Name");

Running in the emulator this is fine, I get the:

Getting "My.Setting.Name" from ServiceRuntime: PASS.

message. However, when I publish to my remote environment, I get:

Getting "My.Setting.Name" from ServiceRuntime: FAIL.
Getting "My.Setting.Name" from ConfigurationManager: FAIL.

messages. In the 'CloudServices/Configure' section of the Azure Management Portal I can see the setting listed in the configuration, and it's set correctly.

I'm using Azure SDK 2.0

Ralph Willgoss
  • 11,750
  • 4
  • 64
  • 67
Charlotte Skardon
  • 6,220
  • 2
  • 31
  • 42

1 Answers1

5

Are you deploying correct Azure SDK .DLL's with your project? Did you by chance upgrade recently to a newer Azure SDK? I would check your .DLL references to make sure that they all match across the solution

Igorek
  • 15,716
  • 3
  • 54
  • 92
  • 2
    It *is* this problem, but due to me using the Nuget Packages for Azure config etc (which is 1.8) and the SDK which is 2.0 – Charlotte Skardon Jun 18 '13 at 14:34
  • 2
    Holy codesticles!!! My code was using nuget 1.8.0.0 also ... instead of the 2.0's This answer saved my life. I'm back baby!! i'm back!!!!!! – Pure.Krome Oct 23 '13 at 09:18
  • Thanks, I had the same issue with a WebRole not reading the Cloud config settings and going straight to the web.config file. – Ralph Willgoss Apr 04 '17 at 14:02