Microsoft is suing the US government over a federal law that lets authorities examine customer emails or online files without the individual's knowledge.
The case comes as the tech industry butts heads with US officials over the privacy rights of customers.
Microsoft says the US is abusing a decades-old law that allows a court to order the company to turn over email or other customer files that are stored on its servers, while prohibiting Microsoft from notifying the customer.
The company says that violates constitutional rights of free speech and protection against unreasonable searches.
Microsoft says in a case filed on Thursday that authorities demanded customer information more than 5,600 times in the last 18 months.
In nearly half of those cases, a court ordered the company to keep the demand secret.