Microsoft will spend $2.5 billion on a new unit aimed at helping its customers implement artificial intelligence (AI).