Microsoft's (MSFT 0.37%) stock has surged nearly 300% over the past five years as the tech giant expanded its cloud business, transformed Windows and Office into services, launched new Xbox and Surface devices, and extended its mobile ecosystem with iOS and Android apps.

CEO Satya Nadella, who adopted a "mobile first, cloud first" strategy upon taking the helm in 2014 before shifting the company's focus to artificial intelligence (AI) a few years later. As a result, the mature tech stock became an exciting growth stock again.

But past performance never guarantees future gains, so investors should take a fresh look at Microsoft to see if it can continue outperforming the market over the next five years.

Microsoft's campus in Redmond.

Image source: Getty Images.

The evolution of Windows into a service

Back in 2015, Microsoft offered Windows 10 as a free upgrade for most Windows 7, 8, and RT users. That move was unprecedented, since Microsoft generated significant revenue from Windows licenses.

Microsoft gave away Windows 10 for two reasons. First, the Windows market was fragmented, and it needed to unite the PC market under a single OS to introduce new services (like the Microsoft Store and Windows Defender) and provide unified security updates.

Second, operating systems like Android and Chrome OS were already free. Those operating systems locked in users, then generated long-term revenue from app stores and other add-on services. Microsoft needed to mirror this strategy or risk falling behind the tech curve.

Giving Windows away to consumers didn't kill the business. Microsoft continued to sell Windows licenses to PC makers and enterprise customers, and it generated additional revenue from the Microsoft Store. As a result, Microsoft's annual revenue from Windows rose from $14.8 billion in fiscal 2015 to $22.3 billion in 2020.

Microsoft probably won't launch a new version of Windows within the next five years. Instead, it will keep updating Windows 10 with new features and apps for the Microsoft Store, and tethering the OS to its other ecosystems -- including its Xbox consoles and mobile apps.

More revelations at its commercial cloud business

Microsoft's "commercial cloud" revenue grew 36% to over $50 billion, more than a third of its top line, in fiscal 2020 (which ended on June 30). The segment's revenue rose another 31% year-over-year to $15.2 billion in the first quarter of 2021.

That business generates most of its revenue from Microsoft 365, its cloud infrastructure platform Azure, and its Dynamics CRM (customer relationship management) platform.

A network of cloud computing connections.

Image source: Getty Images.

Microsoft only discloses the year-over-year revenue growth rates of those businesses, instead of exact revenue or operating profits, which obfuscates comparisons with other cloud giants like Amazon (AMZN -1.64%) and Alphabet's (GOOG 0.74%) (GOOGL 0.55%) Google.

Azure, which ranks second in the cloud platform market after Amazon Web Services (AWS), is Microsoft's highest-growth cloud business. But Azure's growth is decelerating: Its revenue rose just 47% year-over-year in constant currency terms in the first quarter, compared to 63% growth a year ago. Microsoft also hasn't revealed if Azure is profitable.

Meanwhile, Amazon regularly discloses AWS' revenue and operating profits, and the platform is consistently profitable. Alphabet also recently revealed Google Cloud's revenue, but it remains cagey about its profits. Based on those moves, Microsoft could be pressured to reveal a lot more financial information regarding Azure and its other cloud businesses within the next five years.

Looking beyond physical game consoles

Microsoft will launch its new Xbox Series consoles in early November, but it's already set the foundations for the brand's future transformation into a cloud-based service.

The cheaper Xbox Series S, which lacks an optical drive and runs on weaker hardware than the pricier Xbox Series X, is designed with digital downloads and cloud gaming in mind.

Microsoft's Xbox Game Pass, which gives gamers unlimited downloads from a library of over 100 games for a monthly fee, surpassed 15 million subscribers earlier this year. It's now bundling Game Pass, Xbox Live Gold, and its new xCloud cloud gaming service together in its Xbox Game Pass Ultimate package for $15 a month.

Xbox chief Phil Spencer recently teased the possibility of selling cheap streaming sticks in the future, which could transform the Xbox from a console into a cloud-based service. The expansion of the cloud gaming market over the next five years could support that vision -- and fundamentally change the gaming business, which generated $11.6 billion in revenue, or 8% of Microsoft's top line, in fiscal 2020.

As that transition happens, Microsoft could acquire more video game publishers (as it recently did with ZeniMax) to expand its library of exclusive games and widen its moat against cloud-based competitors like Amazon Luna and Google Stadia.

Where will Microsoft be in five years?

Over the next five years, Microsoft's stock should keep outperforming the S&P 500 as the stickiness of its cloud ecosystem, the expansion of Windows, and the growth of its gaming and Surface segments all generate fresh revenue and profits.

It might be a bumpy ride, since macro headwinds and cyclical PC sales can still impact its core businesses, but I believe Microsoft has the right leader and mindset to tackle to those near-term challenges.