The layoffs were part of wider cuts at Microsoft, as the company prioritizes spending on artificial intelligence.