In a few short months, diplomats from nearly all the world’s countries will descend on Azerbaijan, a small petrostate on the Caspian Sea, nestled between Russia and Iran, to wrangle over how best to avoid the ever-growing dangers of climate change.

It’s an unlikely place for such talk: It is out of the way, under authoritarian rule and, crucially, hyper-dependent on fossil fuels. Azerbaijan is hosting the annual climate summit, called COP29, only by dint of a quirky United Nations selection process that left it as the last option on the table.

Mukhtar Babayev, an amiable midlevel bureaucrat put in charge of the talks, scarcely anticipated filling such a high-stakes role. “We are not famous as a green transition ideas developer,” he said last week in a wide-ranging interview in the Azerbaijani countryside. “Yes, for us it is new.”

Mr. Babayev, 56, and his team are tasked with balancing nearly impossibly divergent interests, from dominant petrostates like Saudi Arabia to sinking island​ states like Vanuatu. It’s a nearly vertical learning curve for officials who acknowledge their inexperience in global climate politics.

They also acknowledge that they are under pressure from some people in their own country, who fear the global energy transition away from fossil fuels. Nearly all of Azerbaijan’s exports are oil and gas. Mr. Babayev himself spent most of his career rising through the middle ranks of the state oil company.

And despite broad agreement that the world must stop burning fossil fuels as quickly as possible, Mr. Babayev offered a defense of those who produce them, particularly natural gas, which has transformed his country into a bigger player on the geopolitical stage in recent years as Europe scrambled to find replacements for Russian supplies.