Shares of Microsoft (MSFT 1.75%) charged sharply higher in 2023, soaring 57%, according to data provided by S&P Global Market Intelligence. The rally was in sharp contrast to Microsoft's performance in 2022 when the stock plunged 29%.

While the improving economic landscape no doubt helped fuel the rise, the biggest contributor to Microsoft's impressive gains was the game-changing rise of artificial intelligence (AI).

An AI chatbot superimposed over chat icons on a smartphone.

Image source: Getty Images.

The year of generative AI

2023 kicked off with buzz surrounding the capabilities of ChatGPT, the brainchild of OpenAI. Soon after its release, the chatbot quickly became the fastest-growing consumer application in history, attracting 100 million active users just two months after its debut.

Microsoft had made an initial investment of $1 billion in the company back in 2019, but the ability of generative AI to create original content and streamline mundane and time-consuming tasks was revolutionary. Microsoft reportedly boosted its stake to $13 billion while integrating AI across a wide swath of its products and services -- thus serving as the catalyst for the AI gold rush that followed.

These capabilities led directly to the development of Copilot, a digital assistant designed to interact with Microsoft's core productivity programs to save users time and make them even more productive. Copilot could summarize emails and draft responses, outline meetings, search spreadsheets for items that met specific criteria, create presentations in PowerPoint, and even draft and review computer code.

Copilot was a hit with Microsoft users, with roughly 40% of Fortune 100 companies participating in the company's early access, or "pilot" program. In an interview late last year, CFO Amy Hood said, "The next-generation AI business will be the fastest-growing $10 billion business in our history."

Most recently, Microsoft's Azure Cloud reaped the benefits of the company's AI moves, as its cloud revenue grew 29% year over year, outpacing both Amazon Web Services (AWS) and Alphabet's Google Cloud, which grew 12% and 22%, respectively. This was all the more remarkable since it followed seven consecutive quarters of decelerating year-over-year growth for Azure. Perhaps more importantly, the company attributed the acceleration to AI, with "roughly three points" of its cloud growth resulting from accelerating demand for AI services.

More to come?

There could be more to come for Microsoft. While the company demonstrated resilience in the face of the downturn, its PC segment has only just begun to rebound. Furthermore, we haven't yet seen the full extent of Copilot adoption on Microsoft's results, which will no doubt ramp over time. Evercore IS analyst Kirk Materne suggests that AI could generate incremental revenue of more than $100 billion for Microsoft by 2027. For context, Microsoft generated revenue of roughly $212 billion in fiscal 2023 (which ended June 30), so this represents a significant opportunity.

Its large base of productivity software users and Azure cloud customers gives Microsoft a vast, untapped market to peddle its AI wares. As such, 2023's gains could be just the beginning. Microsoft stock is a buy.