After rocketing higher in 2023, Microsoft (MSFT -1.00%) stock has continued to hit new highs in 2024, currently up 10% year to date. Morgan Stanley analyst Keith Weiss sees even further upside as the company continues to capture growth opportunities in artificial intelligence (AI) services and the broader cloud market.

The investment wing of the bank updated its price target -- a projection for where the stock will trade in the next year or so -- from $465 to $520 and kept an overweight (buy) rating on the shares. This represents a nearly 26% upside over the current share price of $413.

Is Microsoft stock a buy?

Microsoft has executed well in capturing the massive opportunity in AI services. Revenue grew 16% year over year in the most recent quarter, with revenue from Microsoft Azure and other cloud services up 28% in constant currency.

Microsoft Azure is seeing larger deal sizes in the $1 billion-plus range. Over half of the Fortune 500 now use Azure's generative AI service powered by OpenAI.

Morgan Stanley sees growing demand for AI services contributing to strong growth over the next five years. Specifically, the firm expects annualized revenue growth of 14% and earnings growth of 16% through fiscal 2029, which seems reasonable given Microsoft's history of double-digit growth. Assuming the stock's valuation stays the same, this is enough to double the value of the shares.

However, the stock's price-to-earnings (P/E) ratio is stretched to the high side after last year's rally. It can still deliver returns for an investor that holds for many years, but the stock's average P/E multiple over the last 10 years is 32 and it's currently trading at over 35 times this year's earnings estimate.

Wall Street's consensus estimate currently has Microsoft hitting $12.52 in earnings in fiscal 2025 ending in June. Assuming the stock's P/E stretched to 40, that would put the share price at $500 and short of the analyst's target. The analyst may be a bit over-optimistic with this price target.