Apple’s move comes as prices for renewable energy continue to plummet. And signing long-term contracts allows businesses to shield themselves from potentially higher, more volatile charges from a power company. Apple would not say how much it was paying for California Flats’s energy, but Ms. Jackson said last year at a Wall Street Journal conference that it was less than what it paid for commercial power. She said she expected the company to save hundreds of millions of dollars over the life of the contract.

Google, which received its federal energy wholesale designation from the Federal Energy Regulatory Commission in 2010, is a big proponent of the approach Apple is now taking.

“Running any kind of business, having predictability in terms of your operating costs can be very important,” said Gary Demasi, director of operations for data center energy and location strategy at Google, which has been a leading investor in and user of clean energy. “Renewable energy, from a cost perspective, is now competitive with other forms of energy, much more so than it was a few years ago.”

In the United States, the generating capacity of corporate clean energy projects has more than doubled each year since 2013, according to the Business Renewables Center at the Rocky Mountain Institute, which tracks publicly announced deals. In 2015, 11 companies signed up for 3.23 gigawatts’ worth of projects, roughly the equivalent of five coal plants and up from 1.18 gigawatts the year before.

Executives face greater pressure from shareholders and customers to show that they are doing their part to fight climate change. At the same time, corporate energy use has exploded, driven in many cases by the ravenous demands of the data cloud.