Cisco (CSCO 0.06%) and Microsoft (MSFT 0.45%) are generally considered solid long-term investments for conservative investors. Both tech giants have wide moats -- Cisco is the world's top maker of networking hardware, and Microsoft is its biggest software company.

But over the past 12 months, Cisco's stock only rose by the low single digits as Microsoft's stock soared more than 30%. Does that trend indicate that the former is a weaker investment than the latter? Let's dig deeper to find out.

A close-up of a stock chart.

Image source: Getty Images.

Cisco's strengths and weaknesses

Cisco's core infrastructure business -- which sells routers, switches, wireless hardware, and other hardware products -- is a slow-growth one that faces tough competition from rivals like Huawei, Arista Networks, Hewlett Packard Enterprise, and Juniper Networks.

Cisco offsets that slower growth with two main strategies: expanding its portfolio of higher-growth applications and security software (16% of its revenue last quarter) with new products and acquisitions, and bundling those services with its hardware into cost-effective packages.

Those strategies shore up Cisco's defenses against its rivals, but it still faces two long term challenges. First, it faces softer enterprise spending in China, the U.S., and the UK as several big macro issues -- like the trade war and Brexit -- remain unresolved.

Second, a growing number of big enterprise customers are pivoting toward cheaper "white box" alternatives to Cisco's hardware, which run on open-source software and rely on cloud-based SDN (software-defined networking) to do the heavy lifting. Cisco could struggle to lock in those customers as they break free from its hardware and software ecosystem.

Microsoft's strengths and weaknesses

Microsoft owns a sprawling portfolio of software and hardware products, but most of its growth comes from its cloud unit -- which generates most of its revenue from Office 365, its Dynamics CRM (customer relationship management) platform, and Azure.

Azure, the second largest cloud infrastructure platform after Amazon (AMZN 0.83%) Web Services (AWS), is the cloud unit's core growth engine. Its revenue surged 68% annually on a constant currency basis last quarter, which boosted Microsoft's total commercial cloud revenue 39% to $11 billion, or 36% of its top line.

Azure's growth is supported by three main tailwinds: the rising use of cloud-based services, the increasing reluctance of Amazon's rivals (especially retailers) to use AWS, and the expansion of its ecosystem with new availability zones and services.

Two IT professionals in a data center.

Image source: Getty Images.

Microsoft's weakest business in recent quarters was its gaming unit, due to the maturation of the current console generation which started nearly six years ago. However, that business should recover next year when Microsoft launches its next-gen Xbox.

Which company is growing faster?

Cisco's revenue and adjusted earnings rose 7% and 20%, respectively, in fiscal 2019 (which ended on July 27). However, analysts anticipate just 2% revenue growth and 7% earnings growth this year, due to tougher year-over-year comparisons, slower enterprise spending, and ongoing challenges in China.

China only accounts for a small percentage of Cisco's sales, but the region's revenue is falling sharply due to a trade war-related backlash, which locked the company out of bids for network upgrades at state-backed enterprises.

Microsoft's revenue and adjusted earnings rose 14% and 22%, respectively, in fiscal 2019 (which ended on June 30). Wall Street expects its revenue to rise 11% and for its earnings to improve 10% this year.

That forecast assumes that Microsoft's commercial cloud revenue will keep rising, that its new Surface products will attract new customers, and that its gaming ecosystem -- which includes both consoles and popular subscription services like Xbox Game Pass -- will keep expanding.

The dividends and valuations

Cisco started paying a dividend in 2011, and it's raised its payout every subsequent year. It spent 40% of its free cash flow (FCF) on its dividend over the past 12 months, and currently pays a forward yield of 3%. Its stock currently trades at 13 times forward earnings.

Microsoft hiked its dividend annually for 15 straight years. It spent just 36% of its FCF on that payout over the past 12 months, and currently pays a forward yield of 1.5%. Microsoft currently trades at 24 times forward earnings.

Cisco's lower multiple and higher yield might look more appealing to value-seeking investors, but Microsoft's double-digit revenue and earnings growth also justify its higher valuation.

The winner: Microsoft

Cisco and Microsoft are still both stable long-term investments. But if I had to choose one at current prices, I'd pick Microsoft because it has a better diversified business and more irons in the fire (particularly Azure and the next Xbox), and faces fewer near-term headwinds.