Microsoft (NASDAQ:MSFT) shares fell more than 4% in after-hours trading on Monday following a second quarter earnings report that was largely in line with analyst expectations. The company earned $0.71 per share on revenue of $26.5 billion -- consensus analyst estimates called for $0.71 per share on revenue of about $26.3 billion.

Microsoft's cloud business continues to grow at a rapid rate, but demand for Windows and its hardware appears to be contracting to some extent.

Microsoft's cloud continues to surge
Commercial cloud revenue -- which includes Office 365, Windows Azure, and Dynamics CRM -- rose 114% on an annual basis. In total, Microsoft's commercial cloud has an annual run rate of $5.5 billion, and there are now 9.2 million subscribers to Office 365.

Microsoft bulls have long argued that the company's future was tied to the cloud, more so than its traditional PC business. These results seem to support that notion, though to be fair, the growth rate appears to be slowing to some extent: A gain of 114% is no doubt impressive, but less than last quarter, when commercial cloud revenue surged 128%.

Surface revenue remains modest
In contrast, demand for Microsoft's hardware was relatively muted.

Surface-related revenue, which is now composed entirely of the Surface Pro 3 and its accessories, rose 24% on an annual basis but still came in at a modest $1.1 billion. Given that the Surface Pro 3 retails for around $1,000, unit sales may have come in near the 1 million mark, a far cry from the more than 20 million iPads Apple is expected to have sold last quarter.

In terms of smartphones, Microsoft sold 10.5 million, generating $2.3 billion in revenue. That's down more than 11% on a sequential basis. Gaming hardware revenue also fell, down about 10% from last year, but the decline may have been fueled by falling prices rather than a dislike for the product. Microsoft's Xbox One was the best-selling video game console in the U.S. in both November and December, though Microsoft declined to give exact numbers.

Windows stumbles
But the biggest drag on Microsoft's results was likely the performance of its Windows business. Both Windows OEM Pro and non-Pro revenue -- the Windows licenses sold to its hardware partners -- declined 13% on an annual basis.

In recent quarters, Microsoft's Windows business had benefited from the end of Windows XP support. Business users -- still running old machines with Windows XP -- had bought large numbers of new PCs, temporarily (and perhaps artificially) inflating the demand for Windows.

On the consumer side, Microsoft said it enjoyed some license growth, but revenue may have suffered from the growing number of devices running low-cost or even free versions of Windows: Microsoft heavily discounts Windows licenses for tablets with screens smaller than 10.1 inches.

To qualify for some of the Windows discounts, OEMs are required to set the PC's default search engine to Bing, which appears to be flourishing. Admittedly, it remains in a distant second place, but Bing's share of the U.S. search market rose to 19.7%.

A mobile-first, cloud-first world
Microsoft's CEO, Satya Nadella, consistently argues that he's positioning the company for a "mobile-first, cloud-first world." With cloud-related revenue continuing to ramp up at a rapid rate, it appears to be working. Yet its legacy Windows business remains a drag. With its next operating system, Windows 10, slated to be a free upgrade for early adopters, Windows revenue could continue to disappoint in the quarters ahead.

Over the past year, Microsoft has been a great investment, but shareholders should be prepared for more volatility as it continues to transition its business model.