private void UpdateCacheWorkerRolesCloudConfiguration(PublishContext context) { string connectionString = GetStorageServiceConnectionString(context.ServiceSettings.StorageServiceName); var cloudServiceProject = new CloudServiceProject(context.RootPath, null); var connectionStringConfig = new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = string.Empty }; cloudServiceProject.Components.ForEachRoleSettings( r => Array.Exists(r.ConfigurationSettings, c => c.Equals(connectionStringConfig)), r => { int index = Array.IndexOf(r.ConfigurationSettings, connectionStringConfig); r.ConfigurationSettings[index] = new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = connectionString }; }); cloudServiceProject.Components.Save(cloudServiceProject.Paths); }
private static void AddClientDiagnosticLevelToConfig(RoleSettings roleSettings) { ConfigConfigurationSetting clientDiagnosticLevel = new ConfigConfigurationSetting { name = Resources.ClientDiagnosticLevelName, value = Resources.ClientDiagnosticLevelValue }; roleSettings.ConfigurationSettings = GeneralUtilities.ExtendArray<ConfigConfigurationSetting>(roleSettings.ConfigurationSettings, clientDiagnosticLevel); }