This hasn't been the case with Microsoft. They had their most successful era, and created (at the time) the richest man in the world, all while we hated them.
They aren't the biggest player right now, so their main focus is getting people to switch from a different provider (AWS) to Azure. A great way to do that is for the developers to like using Azure more than AWS.
After all, most of Microsoft's "evil years" were when they were on top, not in a distant second place.
I also think that developers have a lot more power in companies, especially smaller and newer companies, than they used.
Who's "we"? The open-source advocate reviled Microsoft in their own clique but the vast majority of the software industry just quietly went on with their lives.
This is true, but "long term interest" for Microsoft means 30, 50, or 100 years from now. People seem to forget that people actually liking your company is important for long term profits, and therefore doing good things is quite easy to align with the notion that companies only do things that make them a profit.
I find myself saying this a lot - companies are by definition amoral (lacking a moral sense or understanding), not immoral. Just because they are driven by profits doesn't mean they don't do things that are moral or good, as many good things are in the interest of a company's profits. Especially their long term profits.