Is it raking in cash right now? No. But that's just now. MS can and I feel is thinking longer term. Everyone is on a "Crash Dammit" Economist front-cover mode right, trying to will a crash into existence. Microsoft can think longer term about it - after all, we see younger generations diving in to make use of related technologies. Older demographics will, and are, slowly finding out what to make of the tech that is free with an OS install, and MS will see what kind of business to make out of that over time.
The problem with this broader topic is that people are restricting the time frame of the conversation to Right Now. MS doesn't need to worry about that so much, in the grand scheme of things.
I'm definitely not hoping for a crash but I do think it's inevitable. The amount investment is insane and I don't see how this can be recouped. It's a textbook bubble. And the collapse of a bubble always has pretty bad effects on the industry which will impact all of us. This is probably the biggest bubble to blow since the dotcom crisis.