The winter of 2010 brought some of Microsoft's darkest days. Bing, the search engine Microsoft built to challenge Google, was burning cash with little to show for it. Smartphones for the first time surpassed the personal computer, Microsoft's comfort zone, as the world's most popular computing device. The must-have tech gadget that holiday season was Apple's new iPad.
Microsoft, a company at the center of the technology world for decades, watched the future pass it by.
Steve Ballmer, Microsoft's chief executive, couldn't afford for that to happen to the company's sprawling business-software empire.
In a surprise move, Ballmer removed Bob Muglia, the leader of the company's fast-growing Server & Tools division. Muglia's departure in 2011 was the last in a string of exits that saw much of Microsoft's brain trust depart.
"It was really dreary," Muglia said of the mood at Microsoft then. "You basically saw a complete self-destruction of the senior leadership team."
But out of that chaos, the nadir of Microsoft's lost decade, the company found a rebirth in cloud computing.
Six years later, Satya Nadella, the man Ballmer tapped to succeed Muglia, is the chief executive of a reinvigorated Microsoft that is reaping the rewards of a bet-the-company push toward web-based software and services.
Microsoft stock hit all-time highs this month, a reflection of investor confidence in Nadella's pivot away from flagging consumer services like smartphones and toward business software delivered on the web. A company that for much of the 2000s tried in vain to fashion itself in the model of Apple or Google found a better target in its back yard in Amazon.com.
Seattle-based Amazon grew up as an online retailer, but the company a decade ago pioneered the business of renting computer power and other technology infrastructure over the internet. Its Amazon Web Services unit, with sales of $11 billion in the most recently reported 12 months, has a wide lead in that arena, analysts say.
Microsoft has pushed hard to catch up, spending billions on new data centers and rewriting its software for delivery via the web.
Those investments are starting to pay off. Microsoft's sales of web-based computing infrastructure brought in about $2.3 billion during the last year, analysts with RBC Capital Markets estimate.
That's a small portion of Microsoft's total revenue, and the service likely isn't profitable yet. But it represents a vital new line of business for a company that relies on a stagnant PC market.
"There's a realization that the conventional wisdom about Microsoft was wrong," said David Smith, an analyst with researcher Gartner. "They saw the tremendous success that Amazon was having, and they adapted because of that."
Microsoft's cloud-computing work started in earnest in 2006, the same year Amazon launched Amazon Web Services.
The goal wasn't to emulate Amazon. Instead, following the ill-fated engineering effort that put together the Windows Vista operating system, a small team of senior engineers started working on stitching together the plumbing behind Microsoft's online services, from Hotmail to search.
A road show and listening tour ensued, with a crew of six engineers piling into a minivan to learn from Microsoft's web-focused units in Silicon Valley.
Back in the Seattle area, the team set up a skunk-works lab in Microsoft's Building 28. It didn't advertise its work to colleagues, most of whom were plugging away on packaged software releases.
"We hid," said Yousef Khalidi, an engineer who was among the first to join the project. "The idea of moving away from shrink-wrapped software was, at the time, radical."
It wasn't long before Bill Gates asked to review the team's work. The co-founder's official role at the company was limited to a board seat, but he still kept a close watch on Microsoft.
Ray Ozzie, Microsoft's chief software architect, said the team wasn't ready.
Gates wouldn't take no for an answer. He insisted, meeting the team in a small conference room one Friday morning and grilling it on its progress.
The following Monday, Gates called another meeting. The project was great, he said, but he wanted the team to go public with its work.
Overnight, the mission had changed from building tools for Microsoft employees to creating a new product for customers.
Bolstered by the addition of a few dozen employees, the team spent years building the first version of what was called the Windows Azure cloud-computing platform. It launched in 2010.
The initial product wasn't very good. Azure was difficult to use, and despite its "Windows Azure" branding, it couldn't run off-the-shelf versions of Windows Server.
The team's biggest bet - that businesses were interested in using web-based tools to build new and futuristic applications - proved to be a dud. Most companies wanted the cloud to replicate something they already did.
"SOMETHING BIG GOING ON"
Microsoft did have a model for what would work.
In 2008, Server & Tools chief Muglia and Andy Jassy, the leader of Amazon Web Services, or AWS, struck a deal.
Some AWS customers wanted to run Microsoft's software on Amazon's infrastructure. Muglia agreed to add Amazon to a program for companies that rent Microsoft tools to their own customers, and pay Microsoft at the end of each month based on how much they used.
Amazon at the time wasn't telling investors much about how AWS was doing. Microsoft, though, had its own indicator: the large and growing number of Microsoft products Amazon was paying for every month.
"We knew that there was something big going on there," said Bob Kelly, a former Microsoft executive.
Microsoft and Google by then had launched competing services, but it was upstart Amazon that was capturing the most customers.
NEW HEAD OF TEAM
Nadella took over Server & Tools in 2011 with a mandate to push harder on cloud computing, colleagues say.
It didn't matter whether customers were ready for web-based tools, the thinking went. The industry was going that direction, and Microsoft could try to lead or risk getting left behind.
"Very quickly, the world changed," said Khalidi, who leads Azure's networking teams today.
Nadella placed Scott Guthrie, a career Microsoft engineering manager, in charge of the Azure team.
One of Guthrie's first moves was to gather Azure's leaders at an off-campus retreat for an experiment: He asked them to try to build an application using their own cloud service.
It didn't go well. Some features didn't work, and some managers failed to complete the online sign-up process to use Azure. "We didn't have everything quite right," Guthrie said.
The team rewrote Azure, with a focus on ease of use and the sort of tools Amazon was having success with. It also had to unlearn lessons from decades spent selling out-of-the-box software.
In the old world, how a product performed was a customer-service issue, walled off from engineers working on adding new features.
In the world of live web services, customer service became part of the engineering work.
Nadella instituted weekly meetings in which senior leaders spent hours delving into how customers used Microsoft services, as measured by about 3,000 metrics.
If a portion of Azure's network fails in Southeast Asia, for example, "We want to know why, and we want to know in an excruciating depth what we are doing to make sure it doesn't happen again," Guthrie said.
Revenue isn't discussed. "We focus on customer metrics, and what we find is when we improve them, our revenue keeps going up," he said.
Azure relaunched in 2013 with a set of infrastructure services that performed many of the same functions as Amazon's AWS.
A month after Nadella replaced Ballmer as CEO in 2014, he signed off on a cosmetic, but hugely symbolic change. "Windows Azure" was renamed "Microsoft Azure."
Windows had been the center of Microsoft's universe for decades. Products had to play well with the operating system or else they wouldn't last long.
Dropping "Windows" was strategic, a reminder to potential customers that Azure could run more than Windows. It was also symbolic of the cultural shift Nadella was trying to engineer as Microsoft, formerly hostile to software built outside its walls, had decided to play nice with Azure.
"He said our business is cloud first, and we have to move away from the shackles that they were tied to in Windows," said Dave Bartoletti, an analyst at Forrester.
Microsoft's Azure has gained traction in the past two years in part by using an old tactic: building off the company's relationship with business-technology buyers.
Most companies buy one Microsoft product or another. Jerin May, a business-technology consultant with West Monroe Partners, says he sees that familiarity paying dividends.
Microsoft's "commercial cloud," which includes sales of Azure, Office 365 and other web-based business software, was on track in September to bring in $13 billion over a full year.
Nadella, Guthrie and Khalidi are typical of the new Microsoft: soft-spoken managers with deep backgrounds in engineering. The company retains its sprawling bureaucracy and penchant for meetings, but introspection and data-driven analysis are in vogue.
Combativeness, particularly when talking about the competition, is out.
Asked in an interview about the rivalry with Amazon, Guthrie, who now leads Microsoft's Cloud and Enterprise group, tipped his cap to his the Seattle company.
"We have a lot of respect for our friends across the lake," Guthrie said. "Our approach has always been, when working on Azure, let's not sort of thump our chest and make claims. Let's actually deliver a better product."
Explore further: Microsoft joins Linux Foundation in another nod to open-source code