Microsoft is suing the US government over the right to tell its users when federal agencies want access to private data.
It says keeping access requests secret is against the US constitution, which states that individuals should be made aware if the government searches or seizes their property.
Microsoft said 5,624 requests for data were made in the past 18 months, and almost half came with a court order forcing the company to keep the demand secret.
"People do not give up their rights when they move their private information from physical storage to the cloud," Microsoft said in the lawsuit, according to the Reuters news agency.
Microsoft added that it felt the government "exploited the transition to cloud computing as a means of expanding its power to conduct secret investigations".
The US Department of Justice has not yet commented.
The case is the latest row pitting US tech giants against the government - with Microsoft rival Apple calling for Congress to take the lead in addressing the wider issue of balancing privacy with national security.
Microsoft's case centres on the Electronic Communications Privacy Act (ECPA), a 30-year-old law several tech firms feel is outdated and being abused.
In a blog post, Microsoft's president and chief legal officer Brad Smith said suing the US government was not something the company took lightly.
"We believe that with rare exceptions, consumers and businesses have a right to know when the government accesses their emails or records," Smith wrote.
"Yet it's becoming routine for the US government to issue orders that require email providers to keep these types of legal demands secret. We believe that this goes too far and we are asking the courts to address the situation."
He went on to stress that Microsoft acknowledged that in some cases investigations needed to remain secret in order to keep people safe or prevent evidence from being destroyed.
However, Smith added: "We question whether these orders are grounded in specific facts that truly demand secrecy. To the contrary, it appears that the issuance of secrecy orders has become too routine."
The ECPA is unpopular among technology companies as it was written well before the days of widespread internet use. The Act could soon be amended after a US congressional panel voted through several proposed reforms.
Microsoft said it wanted "reasonable rules" added to the Act so it could inform more customers about action related to their data.
"If there's a good reason to justify a secrecy order initially and that reason continues, prosecutors should be able to extend the order based on necessity," Smith said.
"If not, we should be able to tell our customer what happened."
The Electronic Frontier Foundation, which campaigns for digital rights, supported Microsoft's move.
"We applaud Microsoft for challenging government gag orders that prevent companies from being more transparent with their customers about government searches of their data," said EFF staff attorney Andrew Crocker in an email.
"In nearly all cases, indefinite gag orders are an unconstitutional prior restraint on free speech and infringe on First Amendment rights. Microsoft's complaint shows it receives a staggering number of these orders.
"We look forward to assisting in this important lawsuit."