"If they will come, they will create another ecosystem and people will live together," Pessina told CNBC's Jon Fortt in an interview announcing the news. "We have never believed that someone could monopolize the market. We believe that if you do the right things you can drive even if you have hard competitors."

Amazon's core business still lies in e-commerce — it has expanded in brick-and-mortar retailing through Amazon Go Stores, its Whole Foods acquisition and other efforts — and at times that's proving to be an advantage to Amazon's competitors in the cloud business. In the case of Walgreens, Amazon's recent push into health care looms large. Although the company has kept its intentions closely guarded, it's making moves like acquiring online pharmacy PillPack and teaming up with J.P. Morgan and Berkshire Hathaway on a long-term plan to improve care and reduce costs for employees.

As Amazon keeps growing, Microsoft is getting involved with ever more retailers. On Tuesday Microsoft said it has signed a multiyear deal with Walgreens Boots Alliance .

Under the deal, Walgreens Boots Alliance is signing up more than 380,000 employees for its Microsoft 365 cloud apps offering, including Office 365, Windows 10, and mobility and security tools. The company will move most of its information technology workloads to Microsoft's Azure public cloud.

Beyond operating Walgreens and Duane Reade stores, Walgreens Boots Alliance has almost 400 distribution centers that deliver to hundreds of thousands of doctors, hospitals, health centers and pharmacies annually, according to its latest annual report. The company acknowledged Amazon's PillPack deal in the report's risk factors section.

The deal will also include tests of "digital health corners" within some Walgreens stores, plus cooperation on research and development and software for managing patient engagement and chronic disease.

Microsoft CEO Satya Nadella said in the CNBC interview the deal was sparked by a conversation about three years ago.

"They [WBA] went through a pretty rigorous process of really finding the right partner who can bring both world class technology, but also the trust in order to be able help them build this ecosystem," Nadella said. "Because, ultimately, this is about broad partnerships that need to be harnessed by Walgreens in order to deliver the services that [they're] envisioning and they needed to find a partner who, on the technology side, has the capability to do that ecosystem orchestration and is trusted, and that is something where we obviously do well in and I'm glad to sort of really bring all of that to this partnership.

Nadella said Microsoft will act as the "glue" for various technology and partnerships that will bring data from multiple sources together in order to establish new programs.

"So it's not just about Microsoft, but it's about again being able to orchestrate that entire ecosystem of tech providers in order to help companies like WBA transform," Nadella said.

Microsoft has recently signed cloud partnerships other big retailers including the Gap, Kroger and Walmart. But AWS retains many retail customers, including Brooks Brothers and Under Armour, as well as health-care companies like Bristol-Myers Squibb and Celgene.

WATCH: Satya Nadella has been tactically more impressive than Apple CEO Tim Cook, says portfolio manager