in src/DependencyManagement/DependencyManager.cs [99:131]
internal string Initialize(ILogger logger)
{
try
{
// Parse and process the function app dependencies defined in the manifest.
_dependenciesFromManifest = _storage.GetDependencies().ToArray();
if (!_dependenciesFromManifest.Any())
{
logger.Log(isUserOnlyLog: true, LogLevel.Warning, PowerShellWorkerStrings.FunctionAppDoesNotHaveRequiredModulesToInstall);
return null;
}
if (WorkerEnvironment.IsLinuxConsumptionOnLegion())
{
throw new NotSupportedException(PowerShellWorkerStrings.ManagedDependenciesIsNotSupportedOnLegion);
}
_currentSnapshotPath = _installedDependenciesLocator.GetPathWithAcceptableDependencyVersionsInstalled()
?? _storage.CreateNewSnapshotPath();
_backgroundSnapshotMaintainer.Start(_currentSnapshotPath, _dependenciesFromManifest, logger);
_newerSnapshotDetector.Start(_currentSnapshotPath, logger);
_currentSnapshotContentLogger.Start(_currentSnapshotPath, logger);
return _currentSnapshotPath;
}
catch (Exception e)
{
var errorMsg = string.Format(PowerShellWorkerStrings.FailToInstallFuncAppDependencies, e.Message);
throw new DependencyInstallationException(errorMsg, e);
}
}