Rahmanullah Gurbaz, on 21, and Rahmat Shah, on 16, fell in the space of four balls with Hardik Pandya and Shardul Thakur taking the wickets.
Left-handed batsmen Shahidi and Umarzai rebuilt the innings with a century partnership, prompting captain Rohit Sharma to rotate his bowlers.
Umarzai completed his second ODI half-century and soon Shahidi completed his half-century by hitting Pandya for a four and followed it up with a six.
Umarzai, who hit two fours and four sixes in his 69-ball innings, also attacked but was bowled by Pandya.
