No matter where you look, headlines about inflation, supply chain issues, potential recession, and more have investors distracted. Despite lingering concerns over economic turbulence, some companies are proving that moving the ball upfield is still very possible.

Microsoft's (MSFT 0.74%) fourth-quarter fiscal 2022 results (for the quarter ending June 30) contained several positive tailwinds. While the near-term outlook remains cloudy, investors with a long-term mindset should take a look at Microsoft as a buying opportunity.

There is a proliferation of cloud computing

While some may harp on Microsoft for missing Wall Street expectations in its fast-growing cloud business, or allow fierce competition from Amazon (AMZN -0.17%) and Alphabet (GOOG 0.72%) (GOOGL 0.83%) to dissuade them from a positive outlook, the post-earnings stock bump may signal positive investor sentiment more broadly.

People working inside a data center.

Image source: Getty Images.

Unlike smaller technology companies, which have seen stock prices plummet over the last several months, tech behemoths like Microsoft have shown signs of resiliency even during a quarter of slowing growth. Perhaps this is due to its ability to generate meaningful cash flow, even during challenging economic environments.

Just last week, Microsoft announced a new service to accelerate the adoption of Oracle workloads on Azure. This positions Microsoft uniquely in the cloud arena, as it's the only public cloud provider with direct access to databases running in the Oracle Cloud.

While Microsoft's total operating expenses increased 14% year over year, the primary drivers were investments in cloud computing and its professional- and employment-oriented website LinkedIn. These investments seem to be paying off, with 26% year-over-year revenue growth at LinkedIn, and $21 billion in total revenue for Microsoft's Intelligent Cloud business -- driven by its flagship product, Azure, which was up 40% year over year. This level of growth is impressive and has helped fuel a strong and healthy balance sheet.

Cash takes priority at Microsoft

In Q4, Microsoft generated $16.7 billion in net profit. While this was only a modest increase of 1% over the same period last year, the company's total net profit for fiscal 2022 increased an impressive 19% year over year.

This level of consistent profitability has helped Microsoft accumulate quite a bit of cash. At the end of fiscal 2022, the company boasted $105 billion in cash and cash equivalents on its balance sheet. Over the last couple of years it's been deploying cash into other growth areas, and investors are beginning to see tangible benefits.

For example, given the heightened awareness of the subject, Microsoft quietly acquired multiple players in cybersecurity, including CloudKnox Security and RiskIQ. Just as with the cloud, Microsoft also faces stiff competition from Amazon and Alphabet in the cybersecurity space. However, the beauty of both cloud computing and cybersecurity is that the total addressable markets for each are large enough to allow for multiple competitors. According to the earnings transcript, Microsoft's security business was up 40% year over year.

A year later, Microsoft's valuation is lower

As of this writing, Microsoft stock is down 14% year to date. If we analyze some of the key valuation multiples, we can see that Microsoft is trading at a trailing price-to-earnings (P/E) ratio of nearly 29, and a forward P/E of 27. However, at this time last year, these multiples were 37 and 33, respectively. While these don't seem like large compressions, we must remember that Microsoft's market capitalization is over $2 trillion. This means that as its multiples narrow, the company shaves several hundreds of billions of dollars in shareholder value.

During times of economic volatility and stock-market uncertainty, large blue chips could be viewed as safe havens. Given its strong balance sheet, consistent profitability, and inroads in growth markets such as cloud computing and cybersecurity, Microsoft appears to be an attractive long-term buy at this valuation.