This handout image provided by RES Americas shows the 166 megawatt Hackberry Wind Farm near Albany, Texas. As part of an effort to become carbon neutral, Microsoft Corp. has entered a 20-year deal to buy power from a new RES Americas wind farm in Texas.

HOUSTON — It takes a lot of energy to store all the data 1 billion people and 20 million businesses plug into their computers, phones, tablets and gadgets. So as part of an effort to become carbon neutral, Microsoft Corp. has entered a 20-year deal to buy power from a new wind farm in Texas, the first time the tech giant is directly purchasing electricity from a specific source.

The deal announced Monday between Microsoft and RES Americas is being funded in part by money collected from a “carbon fee,” an internal tax of sorts that the company has been charging its departments for every ton of carbon produced. Microsoft also hopes the deal will be a model for other parts of its global operations, said Brian Janous, Microsoft’s director of energy strategy.

“We’re definitely looking at this as a first of a kind, but it fits into our overall desire to have more control over our energy supply,” Janous said.

Construction on RES Americas’ $200 million, 55-turbine wind power project, called Keechi, will begin in December and is expected to be operational by June 2015. Microsoft is buying all 430,000 megawatt hours of energy it produces — or enough to power up to 45,000 homes. That’s about 5 percent to 10 percent of the company’s total electricity consumption.

Microsoft declined to say how much it is paying for the 20-year contract. But Robert Bernard, the company’s chief environmental strategist, said it is coming out of the carbon fee funds, which Microsoft previously estimated could amount to about $10 million in the first year that ended on June 30. The fees will fund several projects.

“It’s a sign of the times that the price point for these renewable projects is quite attractive to them,” said Rob Morgan, chief development officer for wind and solar developer RES Americas.

While the wind energy goes directly onto the Texas grid and it never can be known exactly where electricity is coming from at any given time, having renewable sources helps offset the use of coal, for example, which produces more carbon pollution.

The idea is for Microsoft’s data center in San Antonio to pay for at least some wind energy, Janous said. Until now, the company has bought tax credits for renewable energy, but decided it was time to take the next step.

“How do we make sure there is power on the grid that we want to use?” Janous said.

Texas is the nation’s largest producer of wind energy, but most of that power is created on the wide open, windy prairies of West Texas.

The Keechi project, though, is planned for a more densely populated area about 70 miles northwest of Fort Worth, said Shalini Ramanathan, vice president of development for RES in Austin.

“Because it’s close to Dallas-Fort Worth, it’s close to the lode of Dallas-Fort Worth and so the price is very attractive,” Ramanathan said.

Microsoft looked at several other states and projects, but chose Texas in part because of a $6.8 billion transmission line project that brings West Texas-generated wind to more power-hungry parts of the state, Janous said.

Keechi will not be connected to those 3,500 miles of high-voltage lines, Ramanathan said, but will benefit because the lines help prevent congestion on the grid.

Microsoft also is looking for ways to make data-storage systems and servers more efficient, to develop software and other products that could make “green” buildings more efficient and improve and expand a setup that allows servers to operate in warmer temperatures, giving some data centers the ability to use natural air and water for cooling instead of traditional, power-hungry air conditioning units, Janous said.

“As you can imagine when you have that much concentration of data it requires a lot of energy to keep those things running ... and those are the challenges of companies like Microsoft, Google,” Janous said. “If we’re going to be a consumer of energy, first let’s reduce as much as we can, and then buy it.”