Microsoft (NASDAQ:MSFT) recently signed a seven-year cloud deal with Walgreens Boots Alliance (NASDAQ:WBA) that tethers over 380,000 Walgreens employees to its Office 365 apps. Walgreens will also use Microsoft's Azure as its preferred cloud provider for its IT infrastructure. Furthermore, the two companies will co-develop digital health platforms powered by Azure and Microsoft's AI technologies, and pilot 12 in-store "digital health corners" for sales of healthcare-related devices.

This broad partnership could help both companies counter Amazon (NASDAQ:AMZN), which competes against Microsoft in the cloud platform market with Amazon Web Services (AWS) and Walgreens in the online pharmacy market with its takeover of PillPack. However, the deal might benefit Microsoft more than Walgreens, which still faces a tough uphill battle as Amazon ramps up its sales of drugs and other healthcare products online.

A young woman checks a prescription for pills with her smartphone.

Image source: Getty Images.

Another piece of Microsoft's cloud strategy

Microsoft generates more annual cloud revenues than Amazon, but most of that revenue comes from cloud software services like Office 365 and Dynamics CRM. Azure accounts for a growing percentage of that business, but it still generates less revenue than AWS.

However, Azure is growing at a faster rate than AWS. In their latest quarters, Microsoft reported that Azure's revenue rose 76% year-over-year, while Amazon's AWS revenue climbed 46%.

These cloud platforms are core pillars of growth for both companies. Microsoft relies on the growth of Azure and its cloud services to lock in enterprise customers and reduce its dependence on Windows OS licenses. Amazon uses the growth of AWS's higher-margin business to offset the lower margins of its online marketplaces, which enables it to expand its Prime ecosystem with loss-leading strategies.

Amazon has a first mover advantage in the cloud platform market, but Microsoft is leveraging its dominance of PC operating systems and enterprise productivity software to tether more customers to Azure.

Microsoft also enjoys a unique advantage with brick-and-mortar retailers. Retailers like Walgreens, which are threatened by Amazon, are less likely to use AWS because it supports the growth of Amazon's online marketplaces. Therefore, Azure is becoming an attractive cloud provider for retailers that don't want to help Amazon -- and that growing list already includes Walmart (NYSE:WMT), Kroger (NYSE:KR), and Gap.

A smart display at a retailer.

Image source: Getty Images.

Expanding into the smart retail and healthcare markets

Microsoft's partnership with Walgreens should boost its commercial cloud revenues, which rose 47% annually to $8.5 billion last quarter. Its in-store digital health corners could also complement its efforts to gather more data from customers for analytics purposes.

We already saw Microsoft implement similar systems for Walmart and Kroger. Walmart is using Microsoft's cloud-based tools to manage its supply chain, monitor energy consumption levels, and control Internet of Things (IoT) devices in its warehouses and stores. Microsoft is also reportedly helping Walmart develop cashierless stores to challenge Amazon Go. Kroger is linking its digital shelves to Azure, which can gather data and change prices based on real-time demand.

Microsoft could eventually roll out similar systems for Walgreens' stores, which are struggling to sell non-pharmacy products like household goods in Amazon's shadow. If Microsoft gathers more customers' health data from Walgreens, it could also support the growth of its own digital health apps -- which are overshadowed by larger health platforms from Apple and Alphabet's Google.

A major win for Microsoft, a minor win for Walgreens

Microsoft's deal with Walgreens reinforces its reputation as the top "anti-Amazon" cloud provider, and simultaneously strengthens Office 365. It also gives it a strong foothold in the healthcare market with access to Walgreens' network of nearly 400 distribution centers, which deliver products to hundreds of thousands of doctors and medical institutions every year.

For Walgreens, partnering with Microsoft could widen its moat against Amazon and improve its operational efficiency, but it probably won't boost its sluggish comparable store sales (which fell 3.2% in the US and 2.6% in the UK last quarter) anytime soon. Yet it's still a step in the right direction, and could help Walgreens match Amazon's blows in the retail and online pharmacy markets.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten, an employee of LinkedIn, a Microsoft subsidiary, is a member of The Motley Fool's board of directors. Leo Sun owns shares of Amazon and Apple. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), Amazon, and Apple. The Motley Fool owns shares of Microsoft and has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.