Microsoft (MSFT -2.45%) stock dropped 28% last year -- its third-worst performance since the company went public in 1986 -- and the situation has only gotten worse this year. The stock is now down 33%, marking its sharpest decline in more than a decade.

Economic challenges fueled Microsoft's fall from grace. High inflation slowed revenue growth and supercharged operating expenses, a one-two punch that led to a disappointing financial performance over the past year. Revenue increased only 15% to $203 billion, and free cash flow climbed a mere 5% to $63 billion. Those metrics decelerated meaningfully compared to the prior year, when revenue rose about 20% and free cash flow jumped 23%.

On the bright side, Microsoft is set to reaccelerate its growth when economic conditions improve. In the meantime, investors should take advantage of this once-in-a-decade buying opportunity.

How Microsoft organizes its business

Microsoft provides a broad range of mission-critical software products and cloud services to hundreds of thousands of organizations around the world. The company breaks its business into three parts: productivity and business processes, intelligent cloud, and more personal computing. Microsoft has significant growth opportunities in each segment.

Productivity and businesses processes

Microsoft is the cornerstone of enterprise productivity, and it has achieved a strong market presence in several commercial software verticals. In fact, Microsoft 365 is the most popular enterprise application suite of any kind, bringing together several industry-leading products (e.g. Office, Teams) that will only become more relevant as businesses continue to invest in digital transformation.

That said, cybersecurity is a particularly exciting growth opportunity within this segment. Microsoft has been recognized as a leader across several industry verticals, including security information and event management, extended detection and response, and access management. And those accolades have come alongside strong financial results. Cybersecurity revenue soared 40% in fiscal 2022 (ended July 31, 2022), and Microsoft increased its security customer count 33% to 860,000 in the most recent quarter. That momentum bodes well for the future. According to Grand View Research, the cybersecurity market will grow at 12% annually to reach $500 billion by 2030.

Dynamics 365 is another exciting growth opportunity that falls under the productivity and business processes umbrella. Dynamics includes solutions for business analytics, enterprise resource planning (ERP), and customer relationship management (CRM), tools designed to improve supply chain management and drive productivity across departments like sales, customer service, and marketing. Microsoft has been recognized as a leader in all categories, and the ERP and CRM markets are expected to grow at a double-digit pace through 2030.

Intelligent cloud

Microsoft Azure is the world's second-largest cloud vendor, and the company is gaining momentum. Azure accounted for 21% of cloud infrastructure and platform services spending in the most recent quarter, up from 19% two years ago. That success stems from its focus on hybrid computing, and its robust suite of developer tools, cutting-edge database solutions, and industry-leading machine learning applications.

That puts Microsoft in a great spot. According to Grand View Research, cloud spending will grow at 16% annually to reach $1.6 trillion by 2030. But Microsoft benefits from immense brand authority and a strong competitive position. Those advantages should help Azure grow more quickly than the broader market.

A semiconductor on which is displayed a cloud glowing blue.

Image source: Getty Images.

More personal computing

Microsoft monetizes its more personal computing segment through Windows licensing, Xbox hardware, and video game content, all of which should contribute to growth over the long term. But the most exciting opportunity here is digital advertising.

Microsoft has quietly become the seventh-largest digital advertiser in the world, and it doubled down on that momentum last year by acquiring ad tech platform Xandr, adding sophisticated tools for data-driven ad buying and media monetization to its portfolio. That acquisition helped Microsoft win an exclusive partnership with Netflix, where it provides the ad tech and sales support Netflix needs for its new ad-supported streaming service.

That positions Microsoft as a key player in the online video ad market, which is expected to grow at 14% annually to reach $362 billion by 2027, according to Omdia. But Microsoft is also well positioned to take share in the broader digital advertising market, which is expected to grow at 9% annually to reach $1.3 trillion by 2030.

The stock trades at an attractive price

In a nutshell, Microsoft has a strong position in many different markets, most of which are expected to notch double-digit growth through the end of the decade. That means Microsoft shareholders can reasonably expect double-digit revenue growth over the same period, perhaps even 20% per year. That makes its current valuation of 8.5 times sales look attractive, and it's certainly a discount to the five-year average of 9.8 times sales.

At that price, Microsoft has a great shot at producing market-beating returns for patient investors. That's why this growth stock is a buy.