Export (0) Print
Expand All

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)

public string ConfigurationSettingName { get; internal set; }

Property Value

Type: System.String

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");
   }
}
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft