public AzureParallelInfrastructureCoordinatorFactory( Uri serviceName, IConfigStore configStore, string configSectionName, Guid partitionId, long replicaId, IInfrastructureAgentWrapper agent) { this.serviceName = serviceName.Validate("serviceName"); configStore.Validate("configStore"); configSectionName.Validate("configSectionName"); this.agent = agent.Validate("agent"); this.configSection = new ConfigSection(TraceType, configStore, configSectionName); this.partitionId = partitionId; this.replicaId = replicaId; try { this.tenantId = AzureHelper.GetTenantId(configSection); } catch (Exception ex) { // this happens on the Linux environment (since there is no registry) this.tenantId = PartitionIdPrefix + partitionId; TraceType.WriteWarning("Unable to get tenant Id from configuration. Using partition Id '{0}' text instead. Exception: {1}", this.tenantId, ex); } // TODO use tenant ID or config section name suffix as base trace ID? this.env = new CoordinatorEnvironment(this.serviceName.AbsoluteUri, this.configSection, tenantId, this.agent); this.activityLogger = new ActivityLoggerFactory().Create(env.CreateTraceType("Event")); this.policyAgentServiceWrapper = new PolicyAgentServiceWrapper(env, activityLogger); }
private Task <IPolicyAgentClient> CreatePolicyAgentClientAsync() { TraceType.WriteInfo("Trying to create policy agent client"); var policyAgentServiceWrapper = new PolicyAgentServiceWrapper(env, activityLogger, silentErrors: true); return(Task.FromResult <IPolicyAgentClient>(new PolicyAgentClient(env, policyAgentServiceWrapper, activityLogger))); }