SAN FRANCISCO — The crowd of people waiting to get into the Apple Store in Union Square on a Tuesday in February 2017 included tourists, shoppers, techies — and Rudy Giuliani, the newly appointed cybersecurity adviser to President Trump.

Giuliani showed up at the San Francisco store after being locked out his iPhone, just 26 days after Trump named him cybersecurity advisor, NBC News reported Thursday, citing interviews with two sources and an internal Apple Store memo.

The former New York mayor had entered his passcode incorrectly 10 times and went to the store for help — a troubling move that suggests a sloppy approach to cybersecurity for someone so close to the president, experts said.

“There’s no way he should be going to a commercial location to ask for that assistance,” said E.J. Hilbert, a former FBI cybercrime agent, told NBC, saying that Giuliani could be vulnerable to hackers and should have turned to White House technical officials for help.

A former Apple employee who was in the store when Giuliani sought help told NBC that the former presidential contender was waiting outside the store’s glassy facade when it opened at 10 a.m. that morning. A tech helped Giuliani erase and reboot his phone.

The news about Giuliani’s visit to the Genius Bar comes after multiple reporters revealed he butt-dialed them from his iPhone — including an NBC reporter who said Giuliani, the president’s personal lawyer, left him an inadvertent message this month in which he could be heard discussing Bahrain and saying “the problem is we need some money.”

On Thursday, California Sen. Kamala Harris called on the State Department Inspector General to open an investigation into Giuliani’s activities abroad, citing the odd voicemail.

“These reports raise a number of serious concerns, especially given allegations that Mr. Giuliani is running a “shadow foreign policy,” Harris wrote in a letter to the inspector general, Steve Linick.

Check back for updates.