This paper presents a bi-level optimization problem to obtain the optimal location and size of the flexi-renewable virtual power plants (FRVPPs) in active distribution networks (ADNs). The upper-level formulation of the problem minimizes a normalized objective function (a dimensionless function), which is a normalized summation of the expected annual energy cost and expected annual energy loss of the ADN, subjects to linearized AC optimal power flow (LAC-OPF) equations. Also, the lower-level problem minimizes the annual investment and expected operating costs of flexible and renewable sources constrained to the planning and operation model of these sources in the FRVPP framework. The suggested scheme incorporates the unscented transformation (UT) method to model the uncertainties of load, energy price, and renewable power generation. Then, the Karush-Kuhn-Tucker (KKT) approach converts the proposed bi-level problem into a single-level optimization formulation to achieve the optimal solution using conventional mathematical solvers. Finally, the proposed scheme is applied to a standard test system. Simulation results confirm the capabilities and superiority of the proposed strategy in improving the technical and economic status of the ADN while obtaining the optimal location and size of renewable and flexible sources in the FRVPP framework from an economic aspect.