Microsoft, fully embracing a model it once saw as a threat, said on Monday that it was buying GitHub, an open software platform used by 28 million programmers, for $7.5 billion.

The deal is a bid by Microsoft to gain ground in the internet era of software development, where applications increasingly run on remote data centers — on so-called cloud computing.

Amazon is the leader in the cloud market so far, but Microsoft has transformed itself in recent years to become a strong No. 2 as a supplier of cloud computing services. Its vital Office productivity applications and database software are available in cloud versions.

Microsoft also competes with Google, IBM, Salesforce and others in the cloud marketplace. All of them are trying to lure software engineers to use their cloud tools and services. The more programmers on a company’s platform, the more software applications are created, attracting customers and still more developers — a flywheel of growth and profit.