In this talk, we will review some powerful properties of sequences of random convex functions, which allow to obtain precise asymptotics for M-estimation, when the loss function is convex in its parameter. More precisely, given iid random variables (in any measurable space) X_1,X_2,…,X_n and a loss function phi(x,t) that is convex in its second parameter t (in Euclidean space), the goal is to estimate a minimizer of E[phi(X_1,t)] only using X_1,…,X_n, possibly on a set defined by convex constraints. We derive the asymptotic distribution of the empirical minimizer, under very mild and natural assumptions.