Microsoft CEO Satya Nadella. Daniel Berman | Bloomberg | Getty Images

Microsoft's cloud business is taking full advantage of the growing fear of Amazon, announcing on Thursday its latest deal with a big retailer. Microsoft said it signed a three-year agreement with Albertsons, the supermarket chain and parent of Safeway and Vons, to make Microsoft Azure the grocer's preferred public cloud. The partnership comes a little over a week after Microsoft disclosed a seven-year deal with Walgreens. While Azure is a distant second to Amazon Web Services, it's winning large retail customers who are seeing Amazon's dominance in commerce expand by the day. In addition to Whole Foods, which Amazon acquired for $13.7 billion in 2017, the e-retailer has been opening up Amazon Go convenience stores, which promote cashierless technology, and has launched its own brands of over-the-counter health products and groceries.

Anuj Dhanda, chief information officer of Albertsons, said Amazon's expansion has hastened his company's efforts to modernize its infrastructure and in-store experiences. Other than deploying on Azure and signing up employees with the Microsoft 365 bundle, Albertsons plans to use Microsoft's artificial-intelligence technology, and the two companies could team up on cashierless systems, which Albertsons has already been testing. "We wouldn't want to develop the technology as much as Amazon would do, but we would say, 'How do we deploy the technology, how do we leverage it?'" Dhanda said. Albertsons chose Azure to be its primary cloud because of its experience with big companies, history with large retailers and strong technical capabilities, and because it isn't a competitor, Dhanda said. Microsoft has picked up recent business from retailers like Gap, Walmart and Kroger. AWS, meanwhile, is still quite competitive in retail, providing its technology to companies including Brooks Brothers and Under Armour.

A woman pushes a cart of groceries to her car outside an Albertson's store in Denver, Colorado. Matthew Staver | Bloomberg | Getty Images