Dias completed the full 90 minutes for A Seleção, while Bernardo was replaced on 70 minutes, as the holders snatched all three points in the Group F opener with three late goals - Raphaël Guerreiro's deflected strike and a Cristiano Ronaldo brace.
Joao Cancelo may also have played but his involvement in the tournament had cruelly been cut short by a positive COVID-19 test.
Reigning Champions Portugal - winners in 2016 - had plenty of chances throughout and looked to have been left frustrated by a spirited Hungary side, who were spurred on by a vocal 60,000-strong crowd in Budapest.
The hosts actually thought they had won it themselves late on when Szabolcs Schon drilled into the near post - only for VAR to rule the goal out for offside.
Elation turned to devastation for the home side when Portugal rallied in the final six minutes, opening the scoring as Guerreiro's shot struck Willi Orban and trickled in off the far post.
A minute later, the Hungary defender conceded a penalty, bringing down Rafa Silva, and Ronaldo converted the spot-kick to seal the points and become the first player in European Championship Finals history to score 10 goals in the competition.
Ronaldo then made it three in injury-time, collecting Rafa Silva's one-two, rounding Péter Gulácsi and slotting home.
Elsewhere in Group F, Ilkay Gundogan's Germany face France tonight in a 20:00 (UK time) kick-off in Munich.
Matchday Two will see City stars lock horns as Portugal face Germany at 17:00 on Saturday 19 June, after Hungary and France go head-to-head (14:00).
Group F will complete with 20:00 kick-offs in both games on 23 June as Germany welcome Hungary and Portugal meet France.