Microsoft Corp. said strength in its cloud-computing business drove record revenue in the latest quarter, extending the strong performance under Chief Executive Satya Nadella that has made it the world’s most valuable public company.

Revenue rose 12% to $33.72 billion from the year-earlier period, the company said Thursday, beating Wall Street estimates. Profit also topped expectations.

The...