Amazon.com Inc. on Thursday reported in its third consecutive record profit, nearly doubling its prior high-water mark, and its fifth straight quarter in the black.

Amazon’s revenue jumped 31% including a 58% gain at its Amazon Web Services cloud computing unit. The company also more than doubled its operating margin, which historically has been razor thin, and issued a cheery outlook for the coming quarter.

Shares...