President Antonio Ramalho Eanes brought Portugal's two-month political crisis to an official resolution today by ordering the dissolution of the National Assembly and setting an early general election for April 25.

The crisis was provoked by the Dec. 19 resignation of Prime Minister Francisco Pinto Balsemao, who had faced persistent attacks on his leadership from within the fractious government coalition of Social and Christian Democrats.

The Socialist and Communist opposition lobbied for Gen. Eanes to call the election for April 25, the ninth anniversary of the bloodless "Revolution of Carnations" that toppled a 50-year dictatorship and an emotionally significant date for the Portuguese. This will be the 15th government since then.

The government parties protested that the date did not give them time to decide whether or not to run again as a coalition or on separate tickets. Party congresses this month are to clarify leadership struggles in both of the party organizations.

The left-leaning Eanes had made it clear he wanted the elections as early as possible to avoid delay in taking urgent economic measures. According to the timetable set by the president, the parties will have to present their candidates by March 1 and campaigning is to begin April 3.

Balsemao's outgoing Cabinet rushed through a provisional budget aimed at tackling a seriously worsening economic recession in a week-long parliamentary marathon before the president dissolved the assembly.

The interim budget was little altered from the crisis measures drawn up by the Cabinet in December but automatically shelved on Balsemao's resignation. It will hold down wage raises to 17 percent and impose a wide range of tax and price increases in an effort to hold down 23 percent inflation and ease a $3 billion current accounts deficit.

Balsemao, who has agreed to remain at the head of a caretaker administration until the election, will also be empowered to negotiate up to $650 million in foreign loans and conclude an agreement with the United States on the renewal of its lease on a strategic air base on the mid-Atlantic Azores Islands, political sources said. But they added that only the government to emerge in April will have the authority to negotiate the Reagan administration's request for its first bases on mainland Portugal.

Despite its own internal feuds and the absence of any clear government program, the opposition Socialist Party is widely expected to appear as the largest single party after the election, but without an absolute majority in the 250-seat assembly. Socialist leader Mario Soares, whose own minority government collapsed in 1979, has made overtures to Balsemao's Social Democrats for the formation of a politically central alliance.

Balsemao, heading his party's moderate wing, has hinted he would welcome such a coalition. But if he lost the leadership struggle in the upcoming congress to hard-liners, Soares would be forced to draw in non-party independents to ensure broad parliamentary support.

Soares has firmly ruled out any alliance with the Stalinist Communist Party, which has held a steady 20 percent of the vote.