Microsoft is spending heavily on AI but is also taking a “responsible” approach to its financials, an analyst said.