> How exactly would we draft laws to this effect, "the authorities can subpoena for any piece of evidence, except when complying to such a request might break the contractual obligations of a third party towards the suspect"?
Perhaps in this case they should be required to get a warrant rather than a subpoena?
A subpoena (specifically a subpoena duces tecum[1]) is the legal instrument that a court or other legal agency uses to compel someone to provide evidence. Seems entirely appropriate in this case.
[1] The other kind is subpoena testificandum, which compels someone to testify.
And they do. But if they want to compel your accountant to provide evidence (say) they use a subpoena. So if they want to compel Microsoft to provide evidence they should use a subpoena.
A technical difference being that your key/password is not itself "evidence" of anything. A practical difference being that the relationship is more akin to that of a landlord rather than an accountant.
Perhaps in this case they should be required to get a warrant rather than a subpoena?