The host nation struggled to get past Tanzania until striking talisman Brahim Diaz found the net in the second half as Morocco won 1-0.