This topic has not yet been rated - Rate this topic

RoleEnvironmentConfigurationSettingChange.ConfigurationSettingName Property

Gets the name of the configuration setting that has been changed.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
'Usage

public string ConfigurationSettingName { get; }

Property Value

Type: System.String

A String that contains the name of the configuration setting.

If the setting name is coming from the RoleEnvironmentChangedEventArgs object, the value is the new value. If the setting name is coming from the RoleEnvironmentChangingEventArgs object, the value is the old value because the change has not been applied yet. The value of the setting can be obtained with the GetConfigurationSettingValue method.

The following code example shows how to write out the setting names and values that have been changed:


public override bool OnStart() 
{
   RoleEnvironment.Changed += RoleEnvironmentChanged;
 
   return base.OnStart();
}

private void RoleEnvironmentChanged(object sender, RoleEnvironmentChangedEventArgs e)
{
   // Get the list of configuration changes
   var settingChanges = e.Changes.OfType<RoleEnvironmentConfigurationSettingChange>();
      
   foreach (var settingChange in settingChanges) 
   {
      var settingName = settingChange.ConfigurationSettingName;
      var settingValue = 
         RoleEnvironment.GetConfigurationSettingValue(settingName);
      Trace.WriteLine(settingName + ": " + settingValue, "Information");
   }
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.