In its earnings statements Microsoft doesn't provide exact revenue for Azure, but the company does talk about Azure revenue under its commercial cloud heading, which also includes Dynamics 365 and Office 365 commercial plans. Microsoft's commercial cloud "strength should continue as unit and pricing trends remain positive," Stifel analysts Brad Reback and Adam Borg noted earlier this week, providing an estimate of an $18 billion annualized revenue run rate. In fact commercial cloud came in at a $18.9 billion revenue run rate, meaning that the figure has more than doubled in the past two years.

Azure revenue increased 97 percent year over year, and Azure's gross margin improved in the quarter, Microsoft said in its earnings statement . In the cloud business that Microsoft is so focused on these days, Alphabet with its G Suite and Google Cloud Platform, represents competition. Amazon is also a significant player with its market-leading Amazon Web Services public cloud.

The company beat analysts' estimates on earnings per share and revenue.

Microsoft stock rose by as much as 4 percent after the company reported its earnings for the fourth quarter of its 2017 fiscal year, which ended on June 30. The stock flattened out after the company offered guidance for the next quarter, however, before moving slightly higher again in premarket trading.

Microsoft's Dynamics 365 revenue was up 74 percent, while Dynamics in total increased 7 percent. Commercial Office 365 revenue went up 43 percent.

LinkedIn contributed $1.1 billion in revenue to Microsoft's Productivity and Business Processes segment, whose revenue jumped 21 percent.

Revenue growth in server products and cloud services revenue contributed to the 11 percent gain in Microsoft's Intelligent Cloud segment.

The More Personal Computing segment was the laggard of the bunch, dropping 2 percent. Phone revenue dropped by $361 million and Surface revenue went down 2 percent, but the division was buoyed by gains from Windows, games, and search ads.

Bing growth was a factor in the 8 percent search ad revenue boost; Microsoft said search volume and revenue per search both went up.

With the Surface revenue slide, Microsoft said it sold fewer units, but that factor was offset by the introduction of "a higher mix of premium devices." New Surface products include the Surface Laptop and revamped Surface Pro. "I'm expecting an uptick in Surface the next quarter as Surface Laptop and Surface Pro become fully available across all channels and countries," analyst Patrick Moorhead of Moor Insights & Strategy told CNBC in an email.

Xbox hardware revenue fell 29 percent; Microsoft pointed to lower prices and a decline in the number of consoles it sold.

For the full fiscal year, Microsoft made $25.9 billion in non-GAAP net income, or $21.2 billion in GAAP net income. Non-GAAP revenue for the full fiscal year was $96.7 billion.

In terms of guidance, excluding corporate and other revenue, Microsoft expects to post $23.6-24.3 billion in revenue in the first quarter of its 2018 fiscal year, which ends on September 30, chief financial officer Amy Hood said on the company's earnings call. After Hood provided those numbers, Microsoft stock dropped in after-hours trading, falling to as much as 1.5 percent below the stock's $74.22 closing price.

Earlier this month, the company said it would lay off thousands of employees, primarily in sales, in an effort to boost its cloud business as it begins its 2018 fiscal year.

Microsoft stock hit an all-time intra-day high of $74.30 today ahead of earnings. Microsoft stock has increased more than 18 percent since the beginning of the year.