DAVOS, Switzerland—When Satya Nadella took Microsoft Corp.’s helm five years ago, the conventional wisdom was that the company’s glory days were behind it. Its ubiquitous Windows system was losing its primacy and a costly bet on acquiring Nokia ’s mobile-phone business had failed to pay off. Microsoft’s stock had stagnated for a decade.

Mr. Nadella—Microsoft’s third CEO after Bill Gates and Steve Ballmer—soon dismantled the company’s mobile-phone operations and began making cloud computing the heart of Microsoft’s business. On his watch, revenues from its Azure cloud-computing business have surged and the company’s share price has nearly tripled, allowing Microsoft to reclaim the title of the world’s most valuable company late last year for the first time since 2003. The company said this week that Azure grew 76% in the just-ended quarter, though a chip-shortage curbed Microsoft’s overall sales growth.

Mr. Nadella has also made moves to change Microsoft’s culture and make it a more vocal corporate citizen, especially as the tech industry faces greater government and public scrutiny. He and other Microsoft executives have been outspoken in their calls for the responsible use of artificial intelligence. Last year, the company became the first tech giant to call for regulation of facial-recognition technology.

At the World Economic Forum in Davos last week, Mr. Nadella sat down with Wall Street Journal Editor in Chief Matt Murray to discuss his tenure as CEO so far and some of the challenges facing the tech industry. Here are edited excerpts:

WSJ: What was the biggest thing you didn’t expect about being a CEO?