MS is heavily investing on AI because they missed the opportunity of being #1 on the web and on mobile.
However if you go back some decades you will see that Microsoft did have smartphones, before the iPhone, just they weren't as appealing as a product.
This time around I predict it will be the same. When you look at the product (e.g: Visual Studio tools for AI) it looks very featured but not very organized... Microsoft needs to understand that more and more features doesn't mean more perceived value.