Microsoft Corp. and Google owner Alphabet Inc. are reaping the rewards of their investments in artificial intelligence and cloud computing,…