Microsoft (MSFT 1.94%) and Amazon (AMZN -0.18%) own the two largest cloud infrastructure platforms in the world.

Amazon Web Services (AWS) controlled 32% of that market in the third quarter of 2021, according to Canalys. Microsoft's Azure ranked second with a 21% share, while all the other players held single-digit shares.

That dominance makes Amazon and Microsoft two of the top plays on the global cloud computing market, which Grand View Research estimates will expand at a compound annual growth rate (CAGR) of 19.1% from 2021 and 2028. But which tech giant is the better cloud play, as well as the stronger all-around investment?

A cutout of a cloud next to a laptop.

Image source: Getty Images.

The differences between Microsoft and Amazon

Microsoft and Amazon started out in very different places. Microsoft had traditionally generated most of its revenue from on-premise software before Satya Nadella, who took over as the company's third CEO in 2014, adopted a "mobile first, cloud first" mantra and aggressively expanded Azure, Office 365, Dynamics, and its other cloud-based services.

Under Nadella, Microsoft's annualized commercialized revenue rose from just 14% of its revenue in fiscal 2016 to 41% in fiscal 2021. Microsoft leveraged the strength of its on-premise software business to tether more businesses -- particularly retailers that competed against Amazon and didn't want to support AWS -- to its cloud services.

Amazon, which still generates most of its revenue from its online marketplaces, launched AWS in 2002. However, it only started breaking out AWS' revenue and operating profits in 2015. That's when investors realized that AWS generated much higher-margin revenue than its retail business.

Last year, AWS generated just 12% of Amazon's revenue but raked in 59% of its operating profits. AWS' higher-margin business enables Amazon to expand its retail segment and Prime ecosystem with lower-margin strategies, which arguably makes it the bedrock of its entire business.

That's why Jeff Bezos, who vacated the CEO position earlier this year, handed the reins to Andy Jassy, the former chief of AWS.

Which tech giant is growing faster?

The pandemic generated headwinds for Microsoft while stirring up some tailwinds for Amazon. For Microsoft, the pandemic throttled the growth of its enterprise-facing software businesses as large companies shut down. However, it partly offset that slowdown with the expansion of its cloud, Surface, and Xbox gaming businesses as more people worked remotely and stayed at home.

But for Amazon, the pandemic boosted its online sales while generating strong demand for its cloud-based services. Its expenses surged as it spent billions of dollars on COVID-19 safety measures, but its soaring revenue easily offset that temporary pressure on its operating margins.

Microsoft should generate more stable growth in a post-pandemic market than Amazon because its growth wasn't pulled forward too much. However, Amazon will likely face much tougher year-over-year comparisons:

Revenue Growth (YOY)

Previous FY

Current FY

Next FY

Amazon

38%

22%

18%

Microsoft

18%

17%

14%

Source: Amazon, Microsoft, Yahoo Finance, Dec. 22. YOY = Year-over-year. FY = Fiscal year.

In terms of profits, Microsoft should also experience a softer landing than Amazon:

EPS Growth (YOY)

Previous FY

Current FY

Next FY

Amazon

82%

(2%)

26%

Microsoft

38%

14%

14%

Source: Amazon, Microsoft, Yahoo Finance, Dec. 22.

That's because Amazon is ramping up its investments again (especially in digital media) as its revenue growth decelerates. Meanwhile, Microsoft already deployed its biggest "mobile first, cloud first" investments in previous years -- and it won't experience a significant jump in expenses next year.

What do the valuations say?

Neither stock can be considered cheap relative to its near-term growth. Amazon trades at 54 times forward earnings, while Microsoft has a lower forward price-to-earnings ratio of 37.

However, the bulls will argue that both companies deserve to trade at premium valuations because they're well-insulated from inflation. Amazon's e-commerce business could attract bargain hunters as retail prices rise, and both companies' cloud platforms should easily retain their pricing power as the cloud market expands. 

The winner: Microsoft

Microsoft is arguably a better cloud stock than Amazon, for three simple reasons: Azure is growing significantly faster than AWS, it's an attractive option for Amazon's rivals, and its cloud services are tightly tethered to Windows, Office, Dynamics, and its other software platforms.

Microsoft is also a better all-around investment because it's better diversified, it faces easier post-pandemic comparisons, and its stock is cheaper. Both stocks are still solid long-term investments, but I feel much more confident in Microsoft's near- to mid-term growth potential.