Microsoft is competing with Alphabet, Amazon.com and Meta Platforms to dominate the fast-growing technology that generates text, images and other media.