Exemplo n.º 1
0
        public static HostParameters FromTelemetryProvider(ITelemetryFieldsProvider telemetryProvider)
        {
            Contract.Requires(telemetryProvider is not null);

            var result = new HostParameters();

            result.ApplyFromTelemetryProviderIfNeeded(telemetryProvider);

            return(result);
        }
Exemplo n.º 2
0
        public static HostParameters FromEnvironment()
        {
            var result = new HostParameters()
            {
                ServiceDir      = getValue("ServiceDir"),
                Environment     = getValue("Environment"),
                Stamp           = getValue("Stamp"),
                Ring            = getValue("Ring"),
                Machine         = getValue("Machine"),
                Region          = getValue("Region"),
                MachineFunction = getValue("MachineFunction")
            };

            return(result);

            string getValue(string name)
            {
                var value = System.Environment.GetEnvironmentVariable(HostPrefix + name);

                return(!string.IsNullOrEmpty(value) ? value : "Default");
            }
        }