This paper presents a two‐stage adaptive robust optimization framework for day‐ahead energy and intra‐day flexibility self‐scheduling of a technical virtual power plant (TVPP). The TVPP exploits diverse distributed energy resources’ (DERs) flexibility capabilities in order to offer flexibility services to wholesale flexibility market as well as preserving the distribution network's operational constraints in the presence of DER uncertainties. The TVPP aims at maximizing its profit in energy and flexibility markets considering the worst‐case uncertainty realization. In the proposed framework, the first stage models the TVPP's participation strategy in day‐ahead energy market and determines the DERs’ optimal energy dispatch. The second stage addresses the TVPP's strategy in intra‐day flexibility market to determine the DERs’ optimal flexibility capability provision by adjusting their energy dispatch for the worst‐case realization of uncertainties. The uncertainty characteristics associated with photovoltaic units, electric vehicles, heating, ventilation and air conditioning systems, and other responsive loads as well as the transmission network's flexibility capability requests are considered using an adaptive robust approach. Adopting the duality theory, the model is formulated as a mixed‐integer linear programming problem and is solved using a column‐and‐constraint generation algorithm. This model is implemented on a standard test system and the model effectiveness is demonstrated.