“We want to make sure that we’re as transparent as possible,” the mayor added.

Many New York politicians speak at the annual gatherings of the American Israel Public Affairs Committee, or Aipac, and in the past Mr. de Blasio has not been shy about expressing support for Israel.

Image Mayor Bill de Blasio Credit... Todd Heisler/The New York Times

Still, some New Yorkers in his liberal base are not as sympathetic to the Israeli cause. And the conspicuous omission of the mayor’s appearance from his schedule prompted Gawker, a cheeky blog, to publish a headline that read, “Reporter Kicked Out of Bill de Blasio’s Secret Pro-Israel Speech.”

In the speech, which was reported first by the website Capital New York, Mr. de Blasio said the lobby would always have “a friend and ally at City Hall.”

The commitment to defend Israel is “elemental to being an American, because there is no greater ally on earth,” he said.

Capital New York also posted audio excerpts from the mayor’s remarks online.

Mr. de Blasio said New York City had a special bond with Israel not only because of its large Jewish population, but also because of shared values of democracy and open discourse, and the shared experience of confronting terrorism.

“We take inspiration from Israel for how it has stared down terrorism and kept moving forward,” he said.

Mr. de Blasio said he had visited Israel three times, most recently with his wife and son. He said he was especially moved by visiting Sderot, a city in the Negev desert near the Gaza Strip that has been the target of rocket attacks.