The actions of the US Government in this case are clearly illegal.
This action effectively says that a wholly Irish company (Microsoft Ireland Operations Ltd) must hand over data to the US Government simply because it has a shareholder (Microsoft Corp) based in the USA.
So doubtless my bank (Barclays Plc) has US-based shareholders and therefore Uncle Sam has an absolute right to look at my bank statements?
I think not.