Microsoft's (MSFT 0.17%) stock price hit an all-time high after the tech giant posted its first-quarter report on Tuesday, Oct. 26. Its revenue rose 22% year over year to $45.3 billion, beating analysts' estimates by $1.3 billion. Its adjusted earnings grew 25% to $2.27 per share, which cleared expectations by $0.19.

For the second quarter, Microsoft expects its revenue to rise 16%-18% year over year, which also surpasses analysts' expectations for 14% growth.

Microsoft's numbers were impressive, but some investors might be reluctant to buy its stock after its price has already risen nearly 50% this year. Let's review three reasons to buy Microsoft's stock -- as well as one reason to sell it -- to see if it's still a compelling investment at these prices.

A child holds draws "buy" and "sell" arrows on a small blackboard.

Image source: Getty Images.

1. Microsoft Cloud's growth

Microsoft's dramatic growth over the past seven years was led by the expansion of its cloud services, which include Azure, Office 365, Dynamics, LinkedIn, and its other cloud-based software. The company reports the growth of these businesses together as the "Microsoft Cloud."

Microsoft Cloud's revenue rose 36% year over year to $20.7 billion during the first quarter, which matched its 36% growth rate in the fourth quarter.

Azure, Microsoft Cloud's most closely watched segment, grew its revenue 48% on a constant currency basis. That represented an acceleration from Azure's 45% constant currency growth in the fourth quarter, and should allay concerns about a potential slowdown.

Azure's share of the global cloud infrastructure market also rose from 19% to 21% between the third quarters of 2020 and 2021, according to Canalys. That puts it firmly in second place behind Amazon (AMZN 1.53%) Web Services (AWS), which saw its market share stay flat year over year at 32%.

Microsoft likely wouldn't have achieved that growth without Satya Nadella, who took the helm as the company's third CEO in 2014 and aggressively expanded those services with his "mobile first, cloud first" mantra.

2. Reopening tailwinds

During the onset of the pandemic, several of Microsoft's enterprise-facing services -- including Office 365 Commercial, Dynamics 365, and LinkedIn Marketing Solutions -- suffered slowdowns as businesses closed.

But those headwinds waned as more businesses reopened. Office 365 Commercial and Dynamics 365 generated accelerating growth on a constant currency basis in the first quarter, while LinkedIn Marketing continued to grow:

Revenue Growth (YOY)

Q4 2021

Q1 2022

Office 365 Commercial

20%

21%

Dynamics 365

42%

45%

LinkedIn Marketing

91%

59%

Source: Microsoft. Constant currency basis. YOY = Year over year.

That growth of these "reopening" segments, along with the ongoing growth of Azure and its other cloud services, is offsetting the slower growth of Microsoft's Surface and Xbox divisions, which were both affected by the chip shortage and other supply chain constraints during the first quarter.

3. Returning plenty of cash to shareholders

Microsoft transformed into a high-growth company again over the past few years, but it continues to return tens of billions of dollars to its investors.

Microsoft spent over $39 billion on dividends and buybacks in fiscal 2021, which represented about 70% of its free cash flow (FCF). It spent another $10.9 billion, or 58% of its FCF, on both plans in the first quarter of 2022.

Microsoft's forward dividend yield of 0.8% won't attract any serious income investors, but it reduced its share count by nearly 10% over the past seven years, while offsetting the dilution from its share-based compensation plans.

The one reason to sell Microsoft: its valuation

Microsoft is worth $2.4 trillion today, roughly eight times its market cap of about $300 billion when Satya Nadella took over as its CEO.

Its stock currently trades at 13 times this year's sales and 35 times forward earnings. Those valuations are a bit frothy compared to analysts' expectations for 14% sales growth and 9% earnings growth this year.

That massive market cap and high valuation could make it difficult for Microsoft to replicate its multibagger gains from the past seven years.

Is it the right time to buy Microsoft?

Microsoft's stock is richly valued, but the bears have been banging that same drum for years as its shares have skyrocketed. I believe Microsoft deserves that premium valuation since it's still a solid long-term investment that will continue to profit from the secular expansion of the cloud services market.