It took just an afternoon for the market to forget about Microsoft's (MSFT -1.00%) confirmation that it's investing $10 billion into ChatGPT creator and parent company OpenAI. Microsoft reported sputtering overall growth and weakening profit margins as cloud-spending increases decelerated and PC and laptop sales decline. 

Beneath the noise of quarterly financial reports, though, Microsoft's move on OpenAI is an offensive strike against other public cloud giants like Amazon with its AWS and Alphabet's Google Cloud. Is Microsoft now the best artificial-intelligence (AI) stock around for 2023 and beyond?

AI is "the next big platform wave" for the cloud

Despite extreme economic headwinds, it's clear that cloud computing is still growing -- and it will be the primary force behind Microsoft's long-term progress. In its second quarter of fiscal 2023 (the three months ended Dec. 2022), intelligent cloud revenue was up 18% year over year to $21.5 billion.

That segment is primarily driven by its public cloud business Azure, which Microsoft said grew 31% year over year (or 38% when excluding currency exchange effects due to the strong U.S. dollar). The intelligent cloud represented 41% of total revenue in the last quarter.  

For the time being, this cloud strength is being dragged down by dismal declines in PC and laptop sales, as reflected in Microsoft's 19% year-over-year decline in its "more personal computing" segment to $14.2 billion. In the third quarter of the current fiscal year, cloud growth is expected to continue (Azure will be up year over year in the high-20% range), offset by ongoing PC sales weakness.

But Microsoft has its eye on the future of the cloud, and that's where OpenAI and its viral hit ChatGPT come in. After increasing its investment by $10 billion, Azure will become the exclusive cloud provider for OpenAI. The Azure OpenAI service was launched for commercial users in mid-January as well.

The rationale behind this big bet? In replying to an analyst question, CEO Satya Nadella said, "We fundamentally believe that the next big platform wave [...] is going to be AI," when it comes to the next run higher in cloud computing growth.

Infusing computer-generated automation throughout a workflow (everything from simply answering a question to creating software code) with something like ChatGPT could give Microsoft Azure a huge advantage over competitors like AWS and Google Cloud when competing for new deals with potential customers.

Google, which helped produce the technology ChatGPT is based on, has competing AI services of its own. It has yet to release them for public use, though. As the company has explained, it fears inaccuracies in the responses AI services like ChatGPT generate could hurt its reputation, especially in its bread-and-butter Google Search business. Microsoft, on the other hand, doesn't seem to have those qualms as it pushes forward with the investment. Public cloud pioneer Amazon AWS has AI chatbot services, too, but nothing with the runaway popularity of ChatGPT.  

Is Microsoft the AI stock for you?

All of this might sound like Microsoft is a screaming buy right now. I'm not quite so enthusiastic -- at least not yet. The PC market is going to be a headwind through the rest of Microsoft's fiscal 2023, which ends in June of this year, and will correspond with what the semiconductor industry is saying will be the approximate end of the current consumer electronics slump.

Basically, over the next six months, Microsoft's revenue might manage no more than single-digit-percentage growth with profit margins shrinking along the way (again, due to the strong U.S. dollar).

Meanwhile, Microsoft currently trades for about 28 times trailing-12-month earnings. That can hardly be considered a steal.  

However, things change as we get closer to fiscal 2024 (the second half of calendar year 2023). Microsoft should begin lapping weak results from PC and laptop sales. And if the effects of the Federal Reserve's aggressive interest rate hikes (and the economic turmoil they've unleashed as of late) begin to ease later this year, perhaps Microsoft's cloud growth will accelerate again. Profit margins could be in for a rebound, too, as inflation starts to wear off. 

By a year or two down the road, OpenAI could be deployed throughout the Microsoft ecosystem, driving incremental demand for its cloud platform. 

At the moment, I expect Microsoft will continue to be a volatile stock as it deals with some economic turbulence. For the first half of 2023, I like semiconductor stocks the most (the building blocks of AI and the software services it powers). But if you're looking for a broad-based bet on AI for the coming decade, Microsoft looks like a fair value right now for investors with a long-term mindset.