The second quarter shone a light on the hyperscale battle raging between Amazon Web Services (AWS) and Microsoft Azure, with Canalys reporting an intense Q2 for the rivals.

Those two giants, along with No. 3 Google Cloud, represented 63% of global spending on cloud services in the second quarter and grew 42% collectively, according to the market research firm.

AWS alone accounted for 31% of cloud spend in the quarter, deeming it No. 1 with 33% annual growth. However, Microsoft is continuing to close the gap ahead of it by snagging 24% of the market with 40% annual growth — faster than AWS.

Canalys credits Microsoft's cloud growth to a "record number" of multi-year deals worth $100 million-plus and $1 billion-plus. Furthermore, the firm noted the No. 2 provider's "diverse" go-to-market ecosystem and range of software partnerships are "enabling Microsoft to stay hot on the heels of AWS."

"While opportunities abound for providers large and small, the interesting battle remains right at the top between AWS and Microsoft," Canalys VP Alex Smith said. "The race to invest in infrastructure to keep pace with demand will be intense and test the nerves of the companies’ CFOs as both inflation and rising interest rates create cost headwinds."

The key to pulling in a larger share of the market is continually growing infrastructure, which all big three providers are working on.

In the next year, AWS plans to launch 24 new availability zones in eight regions, and Microsoft plans to launch 10 new cloud regions. Google Cloud, which accounted for 8% of Q2 cloud spend, recently announced Latin America expansion plans.

Increasing investment outside of the U.S. points to providers' aspirations of capturing global demand with low latency and high data sovereignty, Canalys explained.

Microsoft also said it plans to increase the efficiency of its server and network equipment by extending the depreciable useful life from four years to six.

"This will improve operating income and suggests that Microsoft will sweat its assets more, which helps investment cycles as the scale of its infrastructure continues to soar," Smith explained. "The question will be whether customers feel any negative impact in terms of user experience in the future, as some services will inevitably run on legacy equipment."