Microsoft Corp. will invest $1.7 billion to build out cloud computing and artificial intelligence infrastructure in Indonesia, betting on Southeast Asia’s biggest economy to spur growth.