after the events of the congress of vienna in 1814, which granted control of the cities of venice and milan to the kingdom of lombardy-venetia, there was a growing sense of italian nationalism among these territories. this would ultimately lead to the wars of italian independence between 1848 and 1866 which resulted in italian victory.
however, tensions continued as austrian rule remained over certain italian inhabited territories. in light of the conflict between austria and france, italy decided to side with france, as relations between the two countries improved.
i think they supported france in order to expel austria from northern italy