The Prime Minister said the SNP’s position on energy would mean exposing the UK to "continued blackmail" from Vladimir Putin.
Addressing the Scottish Conservative conference in Aberdeen, he called for constitutional divisions to be left behind in the face of the “vicious war” in Ukraine and the economic recovery from the pandemic.
The SNP branded his speech a “tone-deaf insult”.
Elsewhere, Mr Johnson heaped praise on Scottish Conservative leader Douglas Ross, who introduced the Prime Minister despite his throat seizing up due to suspected tonsillitis.
Mr Ross recently U-turned on his call for Mr Johnson to resign over partygate, citing the war in Ukraine. A party source said the pair enjoyed an “upbeat” meeting after Mr Johnson’s address.
In a crowd-pleasing speech that lasted for little more than 15 minutes, the Prime Minister took aim at Nicola Sturgeon’s party, cracked jokes about Alex Salmond and underlined his support for the north-east energy sector.
He told activists Scotland would lead efforts to “wean ourselves off” Russian oil and gas, pointing to investment in offshore wind, tidal, solar, nuclear and hydrogen.
He added: “But I also mean making sensible use of this country’s own natural hydrocarbon resources.
“Are we not crazy to be talking about completely shutting down domestic production, only to buy oil and gas – at a vast mark-up – from Vladimir Putin’s Russia?
“And yet that, unbelievably, is the policy of the SNP and of the Labour Party.”
Mr Johnson said the UK can “continue to lead the world in cutting carbon emissions”.
He said: “But it is also vital to recognise that in this transition there will be a continuing and vital role for oil and gas - not least in producing hydrogen.
“And that’s why it makes sense for the government to help this crucial industry in north-east Scotland with a North Sea transition deal worth £16 billion.
“And what is the policy of Labour and the SNP? Turn off the taps now, cap the wells.
“What a disaster that would be. It means prices up even further, it would mean jobs lost just when householders are feeling the pinch of high gas and oil prices.
“And it means exposing the UK to continued blackmail from Putin.”
The Prime Minister said Mr Ross had been able to “defy the sceptics” by preventing the SNP from winning an overall majority in Holyrood and securing more votes than any other Scottish Conservative leader, including Ruth Davidson.
He added: “And I will tell you why else Douglas has been successful.
“He is the only political leader in Scotland to be saying loud and clear what should be blindingly obvious to everyone - that this is not the moment to be having another referendum.
“This is not the time for yet more delectable disputations about the constitution when our European continent is being ravaged by the most vicious war in Europe since 1945 and when public services and the economy need to recover from the pandemic.”
Mr Johnson said it was “incredible that even now it should be the policy of the SNP to respond to Putin’s sabre-rattling by getting rid of this country’s nuclear deterrent”.
He said: “And be in no doubt that at any UK General Election it would be those terrible twins - Labour and the Nats - each vying to be more left wing, more high-taxing, more generally hectoring and bossy and nannying, that would try to form a coalition.
“And be in no doubt that Labour would rather work with the Nationalists to bring down this government, than work with us to stop the SNP from breaking up Britain.
“When we face so many challenges but also when we have so much going for us, so much to look forward to, let’s put that endless confected division behind us and let’s take this country forward in a way that makes us all proud - delivering prosperity and opportunity at home, and giving the leadership that makes us a force for good around the world.”
Mr Johnson’s speech was preceded by an address by Zhenya Jenny Dove, a Ukrainian living in Edinburgh.
The Prime Minister later told the conference Putin will fail because he “fatally underestimated” the resolve of Ukrainians and western unity.
SNP MSP Rona Mackay said: “Douglas Ross must be regretting his decision to re-invite Boris Johnson after that tone-deaf insult.
“It was an ill-conceived 15-minute charade laced with numerous personal insults and the same old tired bluster but it contained not a single word of comfort for ordinary Scots suffering during this Tory cost of living crisis.
“For a Prime Minister to pitch up and deliver a message bereft of any substance about how he will help families make ends meet exposes just how little he cares about the people of this country.
“Scotland can see right through this partygate Prime Minister who only ever looks out for number one."
Earlier, a senior Tory MSP said the SNP would have to win a majority at the next Holyrood election in order for a second independence referendum to take place.
Stephen Kerr, the party’s chief whip in Holyrood, told The Scotsman: “The SNP would need to get a majority in the Scottish Parliament as far as I am concerned.”
Ms Sturgeon previously said expanding existing North Sea oil and gas fields would take months if not years, while new fields “take years, if not decades, to plan and develop”.
She said: "We must accelerate the transition away from fossil fuels to renewable and low carbon energy, and that's what the Scottish Government remains focused on."
The First Minister told MSPs only around 3 per cent of the UK's gas supplies and around 8 per cent of its oil and petroleum supplies come from Russia.