public InfiniteTimerStandbyManager(IScriptHostManager scriptHostManager, IWebHostLanguageWorkerChannelManager languageWorkerChannelManager,
                                    IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment, IEnvironment environment,
                                    IOptionsMonitor <ScriptApplicationHostOptions> options, ILogger <StandbyManager> logger, HostNameProvider hostNameProvider)
     : base(scriptHostManager, languageWorkerChannelManager, configuration, webHostEnvironment, environment, options,
            logger, hostNameProvider, TimeSpan.FromMilliseconds(-1))
 {
 }
Exemplo n.º 2
0
        public AzureMonitorDiagnosticLogger(string category, string hostInstanceId, IEventGenerator eventGenerator, IEnvironment environment, IExternalScopeProvider scopeProvider, HostNameProvider hostNameProvider)
        {
            _category         = category ?? throw new ArgumentNullException(nameof(category));
            _hostInstanceId   = hostInstanceId ?? throw new ArgumentNullException(nameof(hostInstanceId));
            _eventGenerator   = eventGenerator ?? throw new ArgumentNullException(nameof(eventGenerator));
            _environment      = environment ?? throw new ArgumentNullException(nameof(environment));
            _scopeProvider    = scopeProvider ?? throw new ArgumentNullException(nameof(scopeProvider));
            _hostNameProvider = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));

            _regionName = _environment.GetEnvironmentVariable(EnvironmentSettingNames.RegionName) ?? string.Empty;
        }
Exemplo n.º 3
0
        public WebFunctionsManagerTests()
        {
            _testRootScriptPath     = Path.GetTempPath();
            _testHostConfigFilePath = Path.Combine(_testRootScriptPath, ScriptConstants.HostMetadataFileName);
            FileUtility.DeleteFileSafe(_testHostConfigFilePath);

            _hostOptions = new ScriptApplicationHostOptions
            {
                ScriptPath   = @"x:\root",
                IsSelfHost   = false,
                LogPath      = @"x:\tmp\log",
                SecretsPath  = @"x:\secrets",
                TestDataPath = @"x:\test"
            };

            string functionsPath = Path.Combine(Environment.CurrentDirectory, @"..", "..", "..", "..", "..", "sample");

            var fileSystem                = CreateFileSystem(_hostOptions);
            var loggerFactory             = MockNullLoggerFactory.CreateLoggerFactory();
            var contentBuilder            = new StringBuilder();
            var httpClientFactory         = CreateHttpClientFactory(contentBuilder);
            var factory                   = new TestOptionsFactory <ScriptApplicationHostOptions>(_hostOptions);
            var tokenSource               = new TestChangeTokenSource <ScriptApplicationHostOptions>();
            var changeTokens              = new[] { tokenSource };
            var optionsMonitor            = new OptionsMonitor <ScriptApplicationHostOptions>(factory, changeTokens, factory);
            var secretManagerProviderMock = new Mock <ISecretManagerProvider>(MockBehavior.Strict);
            var secretManagerMock         = new Mock <ISecretManager>(MockBehavior.Strict);

            secretManagerProviderMock.SetupGet(p => p.Current).Returns(secretManagerMock.Object);
            var hostSecretsInfo = new HostSecretsInfo();

            secretManagerMock.Setup(p => p.GetHostSecretsAsync()).ReturnsAsync(hostSecretsInfo);
            Dictionary <string, string> functionSecrets = new Dictionary <string, string>();

            secretManagerMock.Setup(p => p.GetFunctionSecretsAsync("httptrigger", false)).ReturnsAsync(functionSecrets);

            var configurationMock = new Mock <IConfiguration>(MockBehavior.Strict);

            configurationMock.Setup(p => p.GetReloadToken()).Returns(new Mock <IChangeToken>().Object);

            var hostIdProviderMock     = new Mock <IHostIdProvider>(MockBehavior.Strict);
            var mockWebHostEnvironment = new Mock <IScriptWebHostEnvironment>(MockBehavior.Strict);

            mockWebHostEnvironment.SetupGet(p => p.InStandbyMode).Returns(false);
            _mockEnvironment = new Mock <IEnvironment>(MockBehavior.Strict);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteContainerReady)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.CoreToolsEnvironment)).Returns((string)null);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteHostName)).Returns(TestHostName);
            var hostNameProvider = new HostNameProvider(_mockEnvironment.Object);

            var workerOptions = new LanguageWorkerOptions();

            FileUtility.Instance = fileSystem;
            _fileSystem          = fileSystem;
            var metadataProvider        = new HostFunctionMetadataProvider(optionsMonitor, NullLogger <HostFunctionMetadataProvider> .Instance, new TestMetricsLogger());
            var functionMetadataManager = TestFunctionMetadataManager.GetFunctionMetadataManager(new OptionsWrapper <ScriptJobHostOptions>(new ScriptJobHostOptions()), metadataProvider, null, new OptionsWrapper <HttpWorkerOptions>(new HttpWorkerOptions()), loggerFactory, new OptionsWrapper <LanguageWorkerOptions>(TestHelpers.GetTestLanguageWorkerOptions()));

            var emptyOptions             = new JobHostInternalStorageOptions();
            var azureBlobStorageProvider = TestHelpers.GetAzureBlobStorageProvider(configurationMock.Object, storageOptions: emptyOptions);
            var functionsSyncManager     = new FunctionsSyncManager(configurationMock.Object, hostIdProviderMock.Object, optionsMonitor, loggerFactory.CreateLogger <FunctionsSyncManager>(), httpClientFactory, secretManagerProviderMock.Object, mockWebHostEnvironment.Object, _mockEnvironment.Object, hostNameProvider, functionMetadataManager, azureBlobStorageProvider);

            _webFunctionsManager = new WebFunctionsManager(optionsMonitor, loggerFactory, httpClientFactory, secretManagerProviderMock.Object, functionsSyncManager, hostNameProvider, functionMetadataManager);
        }
Exemplo n.º 4
0
 public async Task ListenViaLoopbackAsync()
 {
     await server.BindPortAsync(HostNameProvider.GetLoopbackHost(), SHUB_PORT);
 }
Exemplo n.º 5
0
 public async Task ScanViaDefaultAsync()
 {
     await ScanAsync((await HostNameProvider.GetConnectedHostsAsync())[0]);
 }
 public LinuxAppServiceEventGenerator(LinuxAppServiceFileLoggerFactory loggerFactory, HostNameProvider hostNameProvider)
 {
     _loggerFactory    = loggerFactory;
     _hostNameProvider = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));
 }
Exemplo n.º 7
0
        internal static async Task <IEnumerable <FunctionMetadataResponse> > GetFunctionMetadataResponse(IEnumerable <FunctionMetadata> functionsMetadata, ScriptJobHostOptions hostOptions, HostNameProvider hostNameProvider)
        {
            string baseUrl     = GetBaseUrl(hostNameProvider);
            string routePrefix = await GetRoutePrefix(hostOptions.RootScriptPath);

            var tasks = functionsMetadata.Select(p => p.ToFunctionMetadataResponse(hostOptions, routePrefix, baseUrl));

            return(await tasks.WhenAll());
        }
 public SystemTraceMiddleware(RequestDelegate next, ILogger <SystemTraceMiddleware> logger, HostNameProvider hostNameProvider)
 {
     _logger           = logger;
     _next             = next;
     _hostNameProvider = hostNameProvider;
 }
Exemplo n.º 9
0
        internal static string GetBaseUrl(HostNameProvider hostNameProvider)
        {
            string hostName = hostNameProvider.Value ?? "localhost";

            return($"https://{hostName}");
        }
Exemplo n.º 10
0
 public WebFunctionsManager(IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, IOptions <LanguageWorkerOptions> languageWorkerOptions, ILoggerFactory loggerFactory, HttpClient client, ISecretManagerProvider secretManagerProvider, IFunctionsSyncManager functionsSyncManager, HostNameProvider hostNameProvider)
 {
     _applicationHostOptions = applicationHostOptions;
     _logger                = loggerFactory?.CreateLogger(ScriptConstants.LogCategoryHostGeneral);
     _client                = client;
     _workerConfigs         = languageWorkerOptions.Value.WorkerConfigs;
     _secretManagerProvider = secretManagerProvider;
     _functionsSyncManager  = functionsSyncManager;
     _hostNameProvider      = hostNameProvider;
 }
Exemplo n.º 11
0
        public LinuxContainerMetricsPublisher(IEnvironment environment, IOptionsMonitor <StandbyOptions> standbyOptions, ILogger <LinuxContainerMetricsPublisher> logger, HttpClient httpClient, HostNameProvider hostNameProvider)
        {
            _httpClient         = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
            _standbyOptions     = standbyOptions ?? throw new ArgumentNullException(nameof(standbyOptions));
            _environment        = environment ?? throw new ArgumentNullException(nameof(environment));
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _hostNameProvider   = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));
            _memoryActivities   = new BlockingCollection <MemoryActivity>(new ConcurrentQueue <MemoryActivity>(), boundedCapacity: _maxBufferSize);
            _functionActivities = new BlockingCollection <FunctionActivity>(new ConcurrentQueue <FunctionActivity>(), boundedCapacity: _maxBufferSize);

            _currentMemoryActivities   = new ConcurrentQueue <MemoryActivity>();
            _currentFunctionActivities = new ConcurrentQueue <FunctionActivity>();

            var nodeIpAddress = _environment.GetEnvironmentVariable(EnvironmentSettingNames.LinuxNodeIpAddress);

            _requestUri = string.Format(_requestUriFormat, nodeIpAddress);

            _containerName = _environment.GetEnvironmentVariable(EnvironmentSettingNames.ContainerName);

            if (_standbyOptions.CurrentValue.InStandbyMode)
            {
                _standbyOptionsOnChangeSubscription = _standbyOptions.OnChange(o => OnStandbyOptionsChange());
            }
            else
            {
                Start();
            }
        }
 public WebFunctionsManager(IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, ILoggerFactory loggerFactory, IHttpClientFactory httpClientFactory, ISecretManagerProvider secretManagerProvider, IFunctionsSyncManager functionsSyncManager, HostNameProvider hostNameProvider, IFunctionMetadataManager functionMetadataManager)
 {
     _applicationHostOptions = applicationHostOptions;
     _logger = loggerFactory?.CreateLogger(ScriptConstants.LogCategoryHostGeneral);
     _client = httpClientFactory.CreateClient();
     _secretManagerProvider   = secretManagerProvider;
     _functionsSyncManager    = functionsSyncManager;
     _hostNameProvider        = hostNameProvider;
     _functionMetadataManager = functionMetadataManager;
 }
 public HostnameFixupMiddleware(RequestDelegate next, HostNameProvider hostNameProvider)
 {
     _next             = next;
     _hostNameProvider = hostNameProvider;
 }
 public InfiniteTimerStandbyManager(IScriptHostManager scriptHostManager, IWebHostRpcWorkerChannelManager rpcWorkerChannelManager,
                                    IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment, IEnvironment environment,
                                    IOptionsMonitor <ScriptApplicationHostOptions> options, ILogger <StandbyManager> logger, HostNameProvider hostNameProvider, IApplicationLifetime applicationLifetime)
     : base(scriptHostManager, rpcWorkerChannelManager, configuration, webHostEnvironment, environment, options,
            logger, hostNameProvider, applicationLifetime, TimeSpan.FromMilliseconds(-1), new TestMetricsLogger())
 {
 }
Exemplo n.º 15
0
        public FunctionsSyncManagerTests()
        {
            _testRootScriptPath     = Path.GetTempPath();
            _testHostConfigFilePath = Path.Combine(_testRootScriptPath, ScriptConstants.HostMetadataFileName);
            FileUtility.DeleteFileSafe(_testHostConfigFilePath);

            _hostOptions = new ScriptApplicationHostOptions
            {
                ScriptPath   = @"x:\root",
                IsSelfHost   = false,
                LogPath      = @"x:\tmp\log",
                SecretsPath  = @"x:\secrets",
                TestDataPath = @"x:\sampledata"
            };

            string testHostName = "appName.azurewebsites.net";

            _vars = new Dictionary <string, string>
            {
                { EnvironmentSettingNames.WebSiteAuthEncryptionKey, TestHelpers.GenerateKeyHexString() },
                { EnvironmentSettingNames.AzureWebsiteHostName, testHostName }
            };

            ResetMockFileSystem();

            _loggerProvider = new TestLoggerProvider();
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(_loggerProvider);
            _contentBuilder  = new StringBuilder();
            _mockHttpHandler = new MockHttpHandler(_contentBuilder);
            var httpClient                = CreateHttpClient(_mockHttpHandler);
            var factory                   = new TestOptionsFactory <ScriptApplicationHostOptions>(_hostOptions);
            var tokenSource               = new TestChangeTokenSource();
            var changeTokens              = new[] { tokenSource };
            var optionsMonitor            = new OptionsMonitor <ScriptApplicationHostOptions>(factory, changeTokens, factory);
            var secretManagerProviderMock = new Mock <ISecretManagerProvider>(MockBehavior.Strict);
            var secretManagerMock         = new Mock <ISecretManager>(MockBehavior.Strict);

            secretManagerProviderMock.SetupGet(p => p.Current).Returns(secretManagerMock.Object);
            var hostSecretsInfo = new HostSecretsInfo();

            hostSecretsInfo.MasterKey    = "aaa";
            hostSecretsInfo.FunctionKeys = new Dictionary <string, string>
            {
                { "TestHostFunctionKey1", "aaa" },
                { "TestHostFunctionKey2", "bbb" }
            };
            hostSecretsInfo.SystemKeys = new Dictionary <string, string>
            {
                { "TestSystemKey1", "aaa" },
                { "TestSystemKey2", "bbb" }
            };
            secretManagerMock.Setup(p => p.GetHostSecretsAsync()).ReturnsAsync(hostSecretsInfo);
            Dictionary <string, string> functionSecretsResponse = new Dictionary <string, string>()
            {
                { "TestFunctionKey1", "aaa" },
                { "TestFunctionKey2", "bbb" }
            };

            secretManagerMock.Setup(p => p.GetFunctionSecretsAsync("function1", false)).ReturnsAsync(functionSecretsResponse);

            var configuration      = ScriptSettingsManager.BuildDefaultConfiguration();
            var hostIdProviderMock = new Mock <IHostIdProvider>(MockBehavior.Strict);

            hostIdProviderMock.Setup(p => p.GetHostIdAsync(CancellationToken.None)).ReturnsAsync("testhostid123");
            _mockWebHostEnvironment = new Mock <IScriptWebHostEnvironment>(MockBehavior.Strict);
            _mockWebHostEnvironment.SetupGet(p => p.InStandbyMode).Returns(false);
            _mockEnvironment = new Mock <IEnvironment>(MockBehavior.Strict);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteArmCacheEnabled)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteContainerReady)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.CoreToolsEnvironment)).Returns((string)null);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.WebSiteAuthEncryptionKey)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteInstanceId)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteHostName)).Returns(testHostName);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.SkipSslValidation)).Returns((string)null);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebJobsSecretStorageType)).Returns("blob");
            _hostNameProvider     = new HostNameProvider(_mockEnvironment.Object, loggerFactory.CreateLogger <HostNameProvider>());
            _functionsSyncManager = new FunctionsSyncManager(configuration, hostIdProviderMock.Object, optionsMonitor, new OptionsWrapper <LanguageWorkerOptions>(CreateLanguageWorkerConfigSettings()), loggerFactory.CreateLogger <FunctionsSyncManager>(), httpClient, secretManagerProviderMock.Object, _mockWebHostEnvironment.Object, _mockEnvironment.Object, _hostNameProvider);

            _expectedSyncTriggersPayload = "[{\"authLevel\":\"anonymous\",\"type\":\"httpTrigger\",\"direction\":\"in\",\"name\":\"req\",\"functionName\":\"function1\"}," +
                                           "{\"name\":\"myQueueItem\",\"type\":\"orchestrationTrigger\",\"direction\":\"in\",\"queueName\":\"myqueue-items\",\"connection\":\"DurableStorage\",\"functionName\":\"function2\",\"taskHubName\":\"TestHubValue\"}," +
                                           "{\"name\":\"myQueueItem\",\"type\":\"activityTrigger\",\"direction\":\"in\",\"queueName\":\"myqueue-items\",\"connection\":\"DurableStorage\",\"functionName\":\"function3\",\"taskHubName\":\"TestHubValue\"}]";
        }
Exemplo n.º 16
0
        public FunctionsSyncManagerTests()
        {
            _testRootScriptPath     = Path.GetTempPath();
            _testHostConfigFilePath = Path.Combine(_testRootScriptPath, ScriptConstants.HostMetadataFileName);
            FileUtility.DeleteFileSafe(_testHostConfigFilePath);

            _hostOptions = new ScriptApplicationHostOptions
            {
                ScriptPath   = @"x:\root",
                IsSelfHost   = false,
                LogPath      = @"x:\tmp\log",
                SecretsPath  = @"x:\secrets",
                TestDataPath = @"x:\sampledata"
            };

            var jobHostOptions = new ScriptJobHostOptions
            {
                RootScriptPath = _hostOptions.ScriptPath,
                RootLogPath    = _hostOptions.LogPath
            };

            string testHostName = "appName.azurewebsites.net";

            _vars = new Dictionary <string, string>
            {
                { EnvironmentSettingNames.WebSiteAuthEncryptionKey, TestHelpers.GenerateKeyHexString() },
                { EnvironmentSettingNames.AzureWebsiteHostName, testHostName }
            };

            ResetMockFileSystem();

            _loggerProvider = new TestLoggerProvider();
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(_loggerProvider);
            _contentBuilder  = new StringBuilder();
            _mockHttpHandler = new MockHttpHandler(_contentBuilder);
            var httpClient                = CreateHttpClient(_mockHttpHandler);
            var factory                   = new TestOptionsFactory <ScriptApplicationHostOptions>(_hostOptions);
            var tokenSource               = new TestChangeTokenSource <ScriptApplicationHostOptions>();
            var changeTokens              = new[] { tokenSource };
            var optionsMonitor            = new OptionsMonitor <ScriptApplicationHostOptions>(factory, changeTokens, factory);
            var secretManagerProviderMock = new Mock <ISecretManagerProvider>(MockBehavior.Strict);
            var secretManagerMock         = new Mock <ISecretManager>(MockBehavior.Strict);

            secretManagerProviderMock.SetupGet(p => p.Current).Returns(secretManagerMock.Object);
            var hostSecretsInfo = new HostSecretsInfo();

            hostSecretsInfo.MasterKey    = "aaa";
            hostSecretsInfo.FunctionKeys = new Dictionary <string, string>
            {
                { "TestHostFunctionKey1", "aaa" },
                { "TestHostFunctionKey2", "bbb" }
            };
            hostSecretsInfo.SystemKeys = new Dictionary <string, string>
            {
                { "TestSystemKey1", "aaa" },
                { "TestSystemKey2", "bbb" }
            };
            secretManagerMock.Setup(p => p.GetHostSecretsAsync()).ReturnsAsync(hostSecretsInfo);
            Dictionary <string, string> functionSecretsResponse = new Dictionary <string, string>()
            {
                { "TestFunctionKey1", "aaa" },
                { "TestFunctionKey2", "bbb" }
            };

            secretManagerMock.Setup(p => p.GetFunctionSecretsAsync("function1", false)).ReturnsAsync(functionSecretsResponse);

            var configuration      = ScriptSettingsManager.BuildDefaultConfiguration();
            var hostIdProviderMock = new Mock <IHostIdProvider>(MockBehavior.Strict);

            hostIdProviderMock.Setup(p => p.GetHostIdAsync(CancellationToken.None)).ReturnsAsync("testhostid123");
            _mockWebHostEnvironment = new Mock <IScriptWebHostEnvironment>(MockBehavior.Strict);
            _mockWebHostEnvironment.SetupGet(p => p.InStandbyMode).Returns(false);
            _mockEnvironment = new Mock <IEnvironment>(MockBehavior.Strict);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteArmCacheEnabled)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteContainerReady)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.CoreToolsEnvironment)).Returns((string)null);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.WebSiteAuthEncryptionKey)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteInstanceId)).Returns("1");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteHostName)).Returns(testHostName);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.SkipSslValidation)).Returns((string)null);
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebJobsSecretStorageType)).Returns("blob");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.KubernetesServiceHost)).Returns("");
            _mockEnvironment.Setup(p => p.GetEnvironmentVariable(EnvironmentSettingNames.PodNamespace)).Returns("");

            _hostNameProvider = new HostNameProvider(_mockEnvironment.Object);

            var functionMetadataProvider = new FunctionMetadataProvider(optionsMonitor, NullLogger <FunctionMetadataProvider> .Instance, new TestMetricsLogger());
            var functionMetadataManager  = TestFunctionMetadataManager.GetFunctionMetadataManager(new OptionsWrapper <ScriptJobHostOptions>(jobHostOptions), functionMetadataProvider, null, new OptionsWrapper <HttpWorkerOptions>(new HttpWorkerOptions()), loggerFactory, new OptionsWrapper <LanguageWorkerOptions>(CreateLanguageWorkerConfigSettings()));

            _functionsSyncManager = new FunctionsSyncManager(configuration, hostIdProviderMock.Object, optionsMonitor, loggerFactory.CreateLogger <FunctionsSyncManager>(), httpClient, secretManagerProviderMock.Object, _mockWebHostEnvironment.Object, _mockEnvironment.Object, _hostNameProvider, functionMetadataManager);
        }
Exemplo n.º 17
0
 public FunctionsSyncManager(IConfiguration configuration, IHostIdProvider hostIdProvider, IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, IOptions <LanguageWorkerOptions> languageWorkerOptions, ILogger <FunctionsSyncManager> logger, HttpClient httpClient, ISecretManagerProvider secretManagerProvider, IScriptWebHostEnvironment webHostEnvironment, IEnvironment environment, HostNameProvider hostNameProvider)
 {
     _applicationHostOptions = applicationHostOptions;
     _logger                = logger;
     _workerConfigs         = languageWorkerOptions.Value.WorkerConfigs;
     _httpClient            = httpClient;
     _secretManagerProvider = secretManagerProvider;
     _configuration         = configuration;
     _hostIdProvider        = hostIdProvider;
     _webHostEnvironment    = webHostEnvironment;
     _environment           = environment;
     _hostNameProvider      = hostNameProvider;
 }
Exemplo n.º 18
0
 public async Task ConnectViaLoopbackAsync()
 {
     await ConnectAsync(HostNameProvider.GetLoopbackHost().CanonicalName);
 }
Exemplo n.º 19
0
 public LinuxAppServiceEventGenerator(LinuxAppServiceFileLoggerFactory loggerFactory, HostNameProvider hostNameProvider, Action <string> writeEvent = null)
 {
     _writeEvent       = writeEvent ?? WriteEvent;
     _loggerFactory    = loggerFactory;
     _hostNameProvider = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));
 }
Exemplo n.º 20
0
 public async Task <List <HostName> > GetListOfHostAsync()
 {
     return(await HostNameProvider.GetConnectedHostsAsync());
 }
 public AzureMonitorDiagnosticLoggerProvider(IOptions <ScriptJobHostOptions> scriptOptions, IEventGenerator eventGenerator, IEnvironment environment,
                                             HostNameProvider hostNameProvider, IOptionsMonitor <AppServiceOptions> appServiceOptions)
     : this(scriptOptions.Value.InstanceId, eventGenerator, environment, hostNameProvider, appServiceOptions)
 {
 }
 public FunctionsSyncManager(IConfiguration configuration, IHostIdProvider hostIdProvider, IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, ILogger <FunctionsSyncManager> logger, IHttpClientFactory httpClientFactory, ISecretManagerProvider secretManagerProvider, IScriptWebHostEnvironment webHostEnvironment, IEnvironment environment, HostNameProvider hostNameProvider, IFunctionMetadataManager functionMetadataManager, IAzureBlobStorageProvider azureBlobStorageProvider)
 {
     _applicationHostOptions = applicationHostOptions;
     _logger                   = logger;
     _httpClient               = httpClientFactory.CreateClient();
     _secretManagerProvider    = secretManagerProvider;
     _configuration            = configuration;
     _hostIdProvider           = hostIdProvider;
     _webHostEnvironment       = webHostEnvironment;
     _environment              = environment;
     _hostNameProvider         = hostNameProvider;
     _functionMetadataManager  = functionMetadataManager;
     _azureBlobStorageProvider = azureBlobStorageProvider;
 }
 public AzureMonitorDiagnosticLoggerProvider(string hostInstanceId, IEventGenerator eventGenerator, IEnvironment environment, HostNameProvider hostNameProvider)
 {
     _hostInstanceId   = hostInstanceId ?? throw new ArgumentNullException(hostInstanceId);
     _eventGenerator   = eventGenerator ?? throw new ArgumentNullException(nameof(eventGenerator));
     _environment      = environment ?? throw new ArgumentException(nameof(environment));
     _hostNameProvider = hostNameProvider ?? throw new ArgumentException(nameof(hostNameProvider));
 }