Massimiliano Allegri was relieved after his AC Milan side qualified for the latter stages of the Champions League with one game to spare.