public BlueprintClient(IAzureContext context, ApiExpandHandler handler) { AzureSession.Instance.ClientFactory.AddHandler(handler); this.blueprintManagementClient = AzureSession.Instance.ClientFactory.CreateArmClient <BlueprintManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager); }
/// <summary> /// Construct a BlueprintClient BlueprintManagementClient. /// </summary> /// <param name="subscription"></param> /// <param name="blueprintManagementClient"></param> public BlueprintClient(IAzureContext context) { //Remove our custom api handler if it's in the current session's custom handlers list var customHandlers = AzureSession.Instance.ClientFactory.GetCustomHandlers(); var apiExpandHandler = customHandlers?.Where(handler => handler.GetType().Equals(typeof(ApiExpandHandler))).FirstOrDefault(); if (apiExpandHandler != null) { AzureSession.Instance.ClientFactory.RemoveHandler(apiExpandHandler.GetType()); } this.blueprintManagementClient = AzureSession.Instance.ClientFactory.CreateArmClient <BlueprintManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager); }