If you can consistently find competitively advantaged businesses that go on to capture large portions of fast-growing markets, you can earn a fortune in the stock market.

Let's take a look at Microsoft (MSFT -1.27%) to see if the software colossus fits the bill.

The bull case for Microsoft's stock

Microsoft holds leading positions within not one, but two of the most powerful technological trends in the world today: artificial intelligence (AI) and cloud computing. Both of these should help to fuel the tech titan's growth in the coming years.

Microsoft made headlines in late January when it announced a multibillion-dollar investment in OpenAI, the famed research laboratory behind the massively popular AI-powered application, ChatGPT. Microsoft wasted little time before integrating OpenAI's technology into its Microsoft Teams communication platform, and it's reportedly working to bring ChatGPT-like capabilities to its Office productivity software. These AI upgrades should make these tools more valuable for users, thereby enabling Microsoft to charge higher prices and earn larger profits over time.

Microsoft could have an even more intriguing growth opportunity in the internet search arena. CEO Satya Nadella wants to use AI to take share from search engine industry leader Alphabet (GOOGL -1.23%) (GOOG -1.10%) in a market that's valued at more than $200 billion, according to analysts at investment bank Jefferies.

To do so, Microsoft recently launched an AI-powered version of its Bing search engine that it says can provide more relevant and complete answers than Google currently offers, via a ChatGPT-like conversational experience. Google is working on its own AI features to defend its market share, but the excitement surrounding ChatGPT could allow Microsoft to wrestle away a significant amount of search users from its rival.

Yet Microsoft's biggest and most exciting growth opportunity likely resides in the cloud. As part of its partnership with OpenAI, Microsoft's Azure became the exclusive provider of cloud computing services for ChatGPT. With Microsoft investing heavily in its AI infrastructure, many other companies are likely to follow OpenAI's lead and build their AI apps on Azure's platform. 

Risks for investors to consider

Although Microsoft's long-term future appears bright, the short term could be a bit rocky. Many businesses are delaying their tech investments due to concerns that the economy could fall into a recession in the coming months. Investors should thus brace for Microsoft's growth to slow, albeit temporarily, in the quarters ahead.

Intensifying competition could also make growth harder to come by. Like Alphabet in search, Amazon (AMZN -2.56%) is a formidable rival in the cloud industry. And like Microsoft, Amazon is investing aggressively in AI technology.

Just days ago, Amazon Web Services (AWS) struck a deal with Hugging Face, a leading machine learning development platform. AWS will serve as Hugging Face's preferred cloud provider and make its impressive slate of AI tools available to the tech start-up's steadily expanding community of developers.

Investors considering an investment in Microsoft should not overlook the threats posed by Microsoft's competitors. That said, the AI and cloud industries are both projected to exceed $1 trillion by the end of the decade. These are massive markets, and there will undoubtedly be more than one winner within them. Thanks in part to its partnership with OpenAI and its entrenched position as a leading provider of cloud infrastructure services, Microsoft is highly likely to be one of them.

A sensible valuation  

The current volatile economic environment is giving long-term-minded investors an intriguing profit opportunity. Following a broad-scale decline in the stock market, Microsoft's shares are currently down more than 20% from their 52-week highs. Its stock now trades for less than 23 times its projected earnings per share in fiscal 2024. That's a fair price to pay for an elite business that could realistically grow its profits by double-digit percentages -- fueled by the rising adoption of AI and cloud services -- well into the next decade.

So, is Microsoft's stock a buy?  

If you're looking for a way to profit from the immense potential of artificial intelligence and cloud computing, Microsoft is an excellent investment to consider buying today.