Microsoft's cloud business has won a marquee deal from one of the country's best-known retailers.

The company said Friday it has signed a five-year deal with Gap to make Microsoft Azure the apparel company's primary cloud provider. It's the latest retailer to choose against handing off its core computing needs to Amazon, which is both the dominant e-retailer and owner of the largest cloud-infrastructure business.

Microsoft announced a big cloud deal with Walmart earlier this year, and Google has picked up business from retailers like Best Buy and Home Depot. Amazon's cloud does have retail customers, including Brooks Brothers and Under Armour.

"What I hear from all these major retailers who are going through this transformation is they want to own their own data and they want a partner that is not going to be a competitor of theirs in any other part of their businesses," said Shelley Bransten, Microsoft's corporate vice president for global retail and consumer goods.

In addition to Gap's use of the Azure public cloud, Gap employees will also receive access to Microsoft 365 services, which include Windows 10, the Office 365 productivity app bundle and the Enterprise Mobility and Security suite. Gap will use the Power BI business-intelligence software as well.

Gap is looking to Azure for e-commerce operations, inventory and workforce systems, Bransten said. The size of the contract was not disclosed.

Companies are moving to the cloud to take advantage of a wider array of real-time services than they can get from traditional data centers and to more efficiently spend their capital, which is of particular concern to older slow-growth businesses.

Gap-branded stores generated less revenue than analysts expected in the company's fiscal second quarter, and the company's stock is down 18 percent this year.

"Retailers don't have endless budgets," said Bransten, who spent more than 15 years at Gap and then worked at Salesforce before joining Microsoft in September. "So certainly moving to the cloud is an opportunity to take costs out and then improve the efficiency of their businesses."

The two companies have other existing connections. Teri List-Stoll, Gap's chief financial officer, is on Microsoft's board.

WATCH: Tech industry needs to work towards the protection of democracy: Microsoft president