Microsoft Corp. and Red Hat Inc., longtime rivals from conflicting camps of the software industry, plan to collaborate in the cloud.

The companies are announcing a partnership Wednesday to make Red Hat’s version of the Linux operating system available to users of Microsoft Azure, the software company’s cloud service.

Under the deal, Microsoft...