That is the new Microsoft - selling cloud services and subscriptions while developing a ton of OSS - naturally they are doing this for profit - but their incentives are now aligned with OSS instead of being in direct conflict.
They also enjoy getting OSS to work for MS later. MS understands very well that Cloud and SaaS is the future. And in B2B, which is their forte, MS Servers don't have much of a play. Hence, their focus is on getting that working for them.
Ex. PyMSSQL is now officially supported by MS. This implies, their costs of maintaining an ODBC driver for Python-MSSQL will be largely reduced thanks to the OSS model.
Same deal with Linux-Azure tooling (there have been many tools that came out), or be it .Net-Core.
They are looking at "extinguishing" Linux not by doing better than competition, but rather by absorbing the competition and getting them to work for MS in the long run. Great business move, not sure for the larger ecosystem.
But then, OSS will always be there. If not Linux, something else.