Finland formally joined the NATO military alliance on Tuesday in a historic policy shift brought on by Russia's invasion of Ukraine, drawing a threat from Moscow of "countermeasures".