public GetSetting ( string settingKey ) : string | ||
settingKey | string | |
return | string |
private static WebHostSettings GetDefaultSettings(ScriptSettingsManager settingsManager) { WebHostSettings settings = new WebHostSettings(); string home = settingsManager.GetSetting(EnvironmentSettingNames.AzureWebsiteHomePath); bool isLocal = string.IsNullOrEmpty(home); if (isLocal) { settings.ScriptPath = settingsManager.GetSetting(EnvironmentSettingNames.AzureWebJobsScriptRoot); settings.LogPath = Path.Combine(Path.GetTempPath(), @"Functions"); settings.SecretsPath = HttpContext.Current.Server.MapPath("~/App_Data/Secrets"); } else { // we're running in Azure settings.ScriptPath = Path.Combine(home, @"site\wwwroot"); settings.LogPath = Path.Combine(home, @"LogFiles\Application\Functions"); settings.SecretsPath = Path.Combine(home, @"data\Functions\secrets"); } if (string.IsNullOrEmpty(settings.ScriptPath)) { throw new InvalidOperationException("Unable to determine function script root directory."); } return settings; }
public PackageAssemblyResolverTests() { _settingsManager = ScriptSettingsManager.Instance; _runPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); _lockFilePath = Path.Combine(_runPath, DotNetConstants.ProjectLockFileName); _oldHomeEnv = _settingsManager.GetSetting(EnvironmentSettingNames.AzureWebsiteHomePath); _targetAssemblyPath = Path.Combine(_runPath, "data\\Functions\\packages\\nuget\\Test.Package\\1.0.0\\lib\\net45"); _targetAssemblyFilePath = Path.Combine(_targetAssemblyPath, Path.GetFileName(this.GetType().Assembly.Location)); Directory.CreateDirectory(_targetAssemblyPath); // Copy current assembly to target package reference location File.Copy(this.GetType().Assembly.Location, _targetAssemblyFilePath); // Create our Lock file using the current assembly as the target File.WriteAllText(_lockFilePath, string.Format(Resources.ProjectLockFileFormatString, Path.GetFileName(this.GetType().Assembly.Location))); _settingsManager.SetSetting(EnvironmentSettingNames.AzureWebsiteHomePath, _runPath); }