Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in Amendment No. 1 to the Registration Statement (Form F-4) and related Prospectus of Allego N.V. for the offer to exchange warrants to acquire ordinary shares and to the incorporation by reference therein of our report dated May 16, 2023, with respect to the consolidated financial statements of Allego N.V. included in its Annual Report (Form 20-F) for the year ended December 31, 2022, filed with the Securities and Exchange Commission.

/s/ Ernst & Young Accountants LLP

Amsterdam, Netherlands

September 22, 2023