Seattle: Microsoft Corp.’s turnaround plan got back on track in the latest quarter, buoyed by rising sales of Internet-based software and services.

Profit in the fiscal fourth quarter exceeded analysts’ estimates and adjusted sales rose 9% as demand almost doubled for Azure cloud services, which let companies store and run their applications in Microsoft data centres. A tax-rate benefit added 23 cents a share to earnings, Microsoft said.

Shareholders are watching closely to gauge whether Satya Nadella is making progress toward reshaping 42-year-old Microsoft as a cloud-computing powerhouse with new services related to Azure and the Office 365 online productivity apps—a shift that led to a massive sales-force restructuring in early July.

The stock has surged 33% in the past year to a record amid signs that the changes are taking root, and the company rewarded that optimism by posting a significant gain in revenue from commercial cloud products along with wider margins for the business.

“They are a company that seems to be ahead of some of these old-line technology companies that are making transitions to the cloud," said Dan Morgan, a senior portfolio manager at Synovus Trust, which owns Microsoft shares. “The story is still intact but they still have a way to go."

Profit excluding certain items in the quarter ended 30 June was 98 cents a share, including the 23-cent tax benefit, Microsoft said on Thursday in a statement.

Excluding that boost, profit would have been 75 cents, still higher than the 71-cent average projection of analysts surveyed by Bloomberg. Revenue climbed to $24.7 billion, compared with estimates for $24.3 billion.

Microsoft shares rose as much as 4.1% in extended trading following the report, then later pared gains to trade near their price at the close in New York, which was $74.22. The stock has jumped 19% in 2017, compared with a 10% gain in the Standard & Poor’s 500 Index.

The company, which cut thousands of sales and marketing jobs in early July to concentrate on selling cloud and newer products like artificial intelligence and data analysis tools, said it recorded costs of $306 million for the restructuring in the fourth quarter.

Cloud revenue

Commercial cloud revenue was $18.9 billion on an annualized basis, moving closer to the $20 billion target the company set for the fiscal year that started 1 July. Even as cloud sales rise, the company has been able to meet a pledge to trim costs, with commercial cloud gross margin widening to 52%.

“In commercial cloud gross margin, we committed a year ago to material improvement and this is 10 points higher than where we were last year," chief financial officer Amy Hood said in an interview.

Azure sales rose 97% in the period, while commercial Office 365—cloud-based versions of Word, Excel and other productivity software—increased 43%.

Microsoft’s Azure cloud-computing service still lags behind market leader Inc, but more customers are starting to go with Microsoft, according to research from Credit Suisse Group AG.

Both corporate and consumer users are switching from older Office programmes to the cloud subscriptions, providing more stable and recurring revenue.

“The underlying trends—the shift to the cloud and also what it means for the legacy, on-premise stuff—are likely to be in motion for a very long period of time," said Sid Parakh, a fund manager at Becker Capital Management, which owns Microsoft stock.

Surface hardware sales slipped 2%, though Microsoft’s Hood said that was better than she had forecast.

In the previous quarter, Microsoft’s Surface revenue fell short because customers weren’t buying aging models of the Surface Pro. Since then, Microsoft unveiled an update to that product—its best-selling Surface—and released a totally new category, a Surface laptop computer with a clamshell design.

Both devices went on sale 15 June and Hood forecast increased momentum for those products as customers start buying machines during back-to-school season.

Overall revenue in the company’s More Personal Computing division, which also includes Windows, was $8.82 billion, above the $8.55 billion average estimate of three analysts polled by Bloomberg.

In the Intelligent Cloud unit, made up of Azure and server software deployed in customers’ own data centres, sales increased 11% to $7.43 billion, compared with the $7.31 billion average analyst projection. Productivity revenue, mainly Office software, climbed 21% to $8.45 billion. Analysts had estimated $8.32 billion.

Chasing Amazon

As more companies shift data and computing tasks to the cloud, Microsoft is trying to narrow Amazon Web Services’ lead and fend off Google’s challenge.

During the quarter, the Redmond, Washington-based software maker unveiled new tools to switch its database customers to the cloud and steal some from rivals like Oracle Corp. Microsoft is also trying to shift more of its Office customers to online subscription versions, while adding cloud business from professional network LinkedIn, acquired in 2016 for $26.2 billion.

In the Credit Suisse survey of customers, Microsoft’s Azure saw the greatest boost among cloud vendors, with 40% of respondents saying Azure was their preferred product, up from 21% six months earlier.

Investors and analysts are paying close attention to the cloud race as they try to project which of the older, established technology companies will profit most and survive in the new world of cloud computing.

Oracle and International Business Machines Corp. have been navigating their own transitions to internet-based computing from legacy hardware and software.

In the fiscal year that began 1 July, the company will continue to spend on capital projects to support its cloud business, and margins will narrow by 1% on expenses related to LinkedIn, Microsoft said.

For the current quarter, which ends in September, sales in the Intelligent Cloud division will come in as high as $7.1 billion, while Productivity unit sales may be as much as $8.3 billion. More Personal Computing sales will be $8.6 billion to $8.9 billion, Hood forecast on a conference call with analysts. Bloomberg