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.
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.