public SynchronizeAzureAzureAnalysisServer() { this.AsAzureHttpClient = new AsAzureHttpClient(() => { HttpClientHandler httpClientHandler = new HttpClientHandler(); httpClientHandler.AllowAutoRedirect = false; return(new HttpClient(httpClientHandler)); }); this.TokenCacheItemProvider = new TokenCacheItemProvider(); this.syncRequestRootActivityId = string.Empty; this.correlationId = Guid.Empty; this.syncRequestTimeStamp = string.Empty; }
protected override void BeginProcessing() { this._dataCollectionProfile = new AzurePSDataCollectionProfile(false); if (AsAzureClientSession.Instance.Profile.Environments.Count == 0) { throw new PSInvalidOperationException(string.Format(Resources.NotLoggedInMessage, "")); } serverName = Instance; Uri uriResult; // if the user specifies the FQN of the server, then extract the servername out of that. // and set the current context if (Uri.TryCreate(Instance, UriKind.Absolute, out uriResult) && uriResult.Scheme == "asazure") { serverName = uriResult.PathAndQuery.Trim('/'); if (string.Compare(AsAzureClientSession.Instance.Profile.Context.Environment.Name, uriResult.DnsSafeHost, StringComparison.InvariantCultureIgnoreCase) != 0) { throw new PSInvalidOperationException(string.Format(Resources.NotLoggedInMessage, Instance)); } } else { var currentContext = AsAzureClientSession.Instance.Profile.Context; if (currentContext != null && AsAzureClientSession.AsAzureRolloutEnvironmentMapping.ContainsKey(currentContext.Environment.Name)) { throw new PSInvalidOperationException(string.Format(Resources.InvalidServerName, serverName)); } } if (this.AsAzureHttpClient == null) { this.AsAzureHttpClient = new AsAzureHttpClient(() => { HttpClientHandler httpClientHandler = new HttpClientHandler(); httpClientHandler.AllowAutoRedirect = false; return(new HttpClient()); }); } if (this.TokenCacheItemProvider == null) { this.TokenCacheItemProvider = new TokenCacheItemProvider(); } base.BeginProcessing(); }
public ExportAzureAnalysisServerLog(IAsAzureHttpClient asAzureHttpClient, ITokenCacheItemProvider tokenCacheItemProvider) { AsAzureHttpClient = asAzureHttpClient; TokenCacheItemProvider = tokenCacheItemProvider; }
public ExportAzureAnalysisServerLog() { AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient()); TokenCacheItemProvider = new TokenCacheItemProvider(); }
public ExportAzureAnalysisServerLog(IAsAzureHttpClient AsAzureHttpClient, ITokenCacheItemProvider TokenCacheItemProvider) { this.AsAzureHttpClient = AsAzureHttpClient; this.TokenCacheItemProvider = TokenCacheItemProvider; }
public RestartAzureAnalysisServer() { this.AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient()); this.TokenCacheItemProvider = new TokenCacheItemProvider(); }
public SynchronizeAzureAzureAnalysisServer(IAsAzureHttpClient AsAzureHttpClient, ITokenCacheItemProvider TokenCacheItemProvider) { this.AsAzureHttpClient = AsAzureHttpClient; this.TokenCacheItemProvider = TokenCacheItemProvider; }