Alitalia credits miles according the marketing carrier code. So the earning rules for EY will apply:
https://www.alitalia.com/en_en/mille...d-airways.html
You would only get miles with a EY flight number, if this flight is operated by EY or AZ:
"Miles can only be earned on flights operated by the Partner Airline or in collaboration between Alitalia and the Partner Company."