Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” and to the incorporation by reference of our report dated May 16, 2023, in Post-Effective Amendment No. 2 to the Registration Statement (Form F-1 No. 333-264056), filed on Form F-3 in order to convert the registration statement on Form F-1 (File No. 333-264056), into a registration statement on Form F-3, and related Prospectus of Allego N.V for the registration of 13,799,948 ordinary shares offered by Allego N.V. and 63,556,529 ordinary shares offered by Selling Securityholders.

/s/ Ernst & Young Accountants LLP

Amsterdam, Netherlands

May 30, 2023