Microsoft is planning job cuts that are expected to affect areas such as sales, consulting, and Xbox as it ramps up AI spending.