Going into Microsoft's (MSFT -3.58%) fiscal third-quarter earnings report, investors were concerned that the weakness in consumer spending would pressure demand for Microsoft's cloud services, which had been a strength for the software giant over the last year.

After the market close on Tuesday, Microsoft reported a better-than-expected 16% year-over-year increase in revenue from the intelligent cloud segment, largely thanks to investments in artificial intelligence (AI).

Infographic of Microsoft Q3 earnings results.

As expected, Microsoft's consumer software products reported weak growth, but Microsoft is gaining momentum in AI cloud services. Here's a look at the company's recent wins in this important market and why the stock could still have room to run.

Microsoft is seeing AI momentum

Overall, commercial bookings for products and cloud services were up 11% year over year to $196 billion, with the annuity mix at 96% of bookings, meaning virtually all of Microsoft's commercial business is based on recurring spending from enterprise customers. This recurring revenue makes Microsoft a safe growth stock to hold for the long term, especially as the company continues to demonstrate leadership in the hottest area of technology.

In a statement, CEO Satya Nadella got to the point as to what is driving this resilient growth: "Across the Microsoft Cloud, we are the platform of choice to help customers get the most value out of their digital spend and innovate for this next generation of AI." 

Nadella added that Microsoft has the "most powerful AI infrastructure." The software giant previously invested in OpenAI, the company behind the popular AI-powered chat engine ChatGPT, and is seeing notable wins with its partnership. It now has over 2,500 Azure OpenAI service customers, a tenfold increase over the previous quarter.

Most importantly, these gains are helping Microsoft close the gap with Amazon -- the leader in cloud services with about 33% share of the market, according to Synergy Research. Microsoft Azure reported a revenue increase of 27% year over year last quarter, which is notably faster than Amazon Web Services' 20% growth reported in the fourth quarter.  

Unless Amazon sees a significant acceleration in the near term, which is unlikely given the macro environment, Microsoft will likely post another share gain against the leader. It's mostly these gains in the cloud services market that are driving Microsoft stock up 24% year to date.

AI is fueling growth in search

The weak point in Microsoft's armor was its consumer business. The company's More Personal Computing segment reported a 9% decline in revenue (7% excluding currency). This was expected, but management noted that Windows devices and usage were higher compared to pre-pandemic levels. Microsoft is still the leader when it comes to computing software, with over 90% of the Fortune 500 currently testing or having already deployed Windows 11.

This leadership in personal computing could translate to more growth from its Bing search engine, which has played second fiddle to Google for years but is starting to come alive thanks to Microsoft's investments in AI.

Since launching the new version of Bing earlier this year, Microsoft has over 100 million daily active users in search, with daily installs of the Bing app up 4 times since launch. That clearly reflects significant market share gains on Google.

AI-driven chat features will play a vital role in the future of search, and Microsoft could leverage its brand and leadership in cloud computing to gain share on Google search in a similar manner to Amazon Web Services. Microsoft's search and news advertising revenue increased 10% year over year for the quarter, or 13% excluding currency. 

Microsoft is not at full strength yet

Overall, Microsoft reported total revenue and earnings growth of 10% and 14% adjusted for currency. While it's uncertain if that can sustainably support the stock's high forward price-to-earnings ratio of 32, it's impressive to see a top tech company still posting double-digit growth in this environment.

Obviously, Microsoft's growth would be much higher if consumer spending were stronger right now. The stock appears fairly valued at these highs but once the consumer market recovers, strong sales of Windows and Office software will fuel even faster revenue and earnings growth, and that could send this AI stock off to the races through the end of the decade.