Microsoft Corp. faces challenges in realizing the returns on its massive investment in artificial intelligence.