© 2017 Author(s). A method for the asymmetric focusing of electron bunches, based on the active plasma lensing technique, is proposed. This method takes advantage of the strong inhomogeneous magnetic field generated inside the capillary discharge plasma to focus on the ultrarelativistic electrons. The plasma and magnetic field parameters inside the capillary discharge are described theoretically and modeled with dissipative magnetohydrodynamic computer simulations enabling analysis of the capillaries of rectangle cross-sections. Large aspect ratio rectangular capillaries might be used to transport electron beams with high emittance asymmetries, as well as assist in forming spatially flat electron bunches for final focusing before the interaction point.