internal override Process CreateWorkerProcess()
        {
            var workerContext = new HttpWorkerContext()
            {
                RequestId        = Guid.NewGuid().ToString(),
                WorkerId         = _workerId,
                Arguments        = _workerProcessArguments,
                WorkingDirectory = _scriptRootPath,
                Port             = _httpWorkerOptions.Port
            };

            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.PortEnvVarName, _httpWorkerOptions.Port.ToString());
            return(_processFactory.CreateWorkerProcess(workerContext));
        }
Exemplo n.º 2
0
        internal override Process CreateWorkerProcess()
        {
            var workerContext = new HttpWorkerContext()
            {
                RequestId        = Guid.NewGuid().ToString(),
                WorkerId         = _workerId,
                Arguments        = _workerProcessArguments,
                WorkingDirectory = _httpWorkerOptions.Description.WorkingDirectory,
                Port             = _httpWorkerOptions.Port
            };

            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.PortEnvVarName, _httpWorkerOptions.Port.ToString());
            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.WorkerIdEnvVarName, _workerId);
            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.CustomHandlerPortEnvVarName, _httpWorkerOptions.Port.ToString());
            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.CustomHandlerWorkerIdEnvVarName, _workerId);
            workerContext.EnvironmentVariables.Add(HttpWorkerConstants.FunctionAppRootVarName, _scriptRootPath);
            Process workerProcess = _processFactory.CreateWorkerProcess(workerContext);

            if (_environment.IsLinuxConsumption())
            {
                AssignUserExecutePermissionsIfNotExists(workerProcess.StartInfo.FileName);
            }
            return(workerProcess);
        }