SEATTLE — Amazon has asked a federal court to let it depose President Trump and Defense Secretary Mark Esper, arguing that hearing from them is essential to determining if they intervened against the internet company when the Pentagon awarded a multibillion-dollar contract to a competitor.

The request, which was unsealed on Monday, escalates a legal battle over a major cloud computing contract to modernize the Pentagon’s operations, called the Joint Enterprise Defense Infrastructure project, or JEDI. Amazon Web Services, the largest cloud provider, was widely considered the front-runner for the $10 billion contract, but in October, the Defense Department surprised analysts when it awarded the project to Microsoft, the No. 2 provider in the market.

Amazon challenged the decision in December, claiming that Mr. Trump used “improper pressure” on the Pentagon to prevent Amazon from winning the contract as part of an attempt to harm the company’s chief executive, Jeff Bezos. Mr. Trump has criticized Mr. Bezos, who also owns The Washington Post, a publication that has reported aggressively on the Trump administration.

“The question is whether the president of the United States should be allowed to use the budget of the D.O.D. to pursue his own personal and political ends,” Drew Herdener, an Amazon spokesman, said in a statement.