On Nov. 8, 2011, President Obama met with then-French President Nicolas Sarkozy in Cannes after what had been a particularly rough week for US-Israeli relations.

The week prior, the UN agency UNESCO admitted Palestine as a member state. Congress responded by cutting off UNESCO’s funding, a move the Obama administration direly opposed. Michael Oren, who served as Israel’s US ambassador from 2009 to 2013, said the president, having opposed Palestine’s admission to the agency, “thought he had done enough . . . and did not need to punish them further.”

President Obama responded to Congress’ act by admonishing Israel for supporting it, with Deputy Secretary of State Tom Nides telling Oren, “UNESCO teaches Holocaust studies, for chrissakes. You want to cut off f–king Holocaust studies?”

The matter was clearly weighing on Obama’s mind as he met with Sarkozy, who himself held Israeli Prime Minister Benjamin Netanyahu in contempt. After Sarkozy called Netanyahu a liar, Obama, who did not realize he was on a live microphone, replied, “You are fed up with him, but I have to deal with him even more often than you.”

Given the longtime alliance between the United States and Israel, one can only wonder — how did we get here?

In his revealing new book, “Ally: My Journey Across the American-Israeli Divide” (Random House), the American-born Oren says that between Netanyahu’s strong will and Obama’s antipathy for Israel, it could hardly have gone any other way.

Having spent years writing about Middle Eastern history, Oren paid special attention to the little-known Sen. Obama when he launched his presidential campaign, and says that Israelis were “confused” by America’s enthusiasm for the candidate.

“Accustomed to leaders like [John] McCain, crusty old soldiers and seasoned pols, they could not understand why Americans would choose a candidate lacking in any military, administrative, or foreign-policy experience,” he writes. Israel chose leaders based on experience rather than appearance, such as “portly Ariel Sharon, diminutive Ehud Barak, and Menachem Begin, who was both follically and visually challenged.”

Researching the candidate by reading his memoirs and his statements on Israel, Oren sensed immediately that “an Obama presidency might strain the US-Israel alliance.”

“With remarkable candor, Obama revealed his opposition to Israeli settlement building and his support for Palestinian rights,” notes Oren, who wrote at the time that Obama “might be expected to show deeper sympathy for the Palestinian demand for a capital in Jerusalem, and greater flexibility in including Hamas in negotiations.”

They could not understand why Americans would choose a candidate lacking in any military, administrative, or foreign-policy experience. - Michael Oren

He also noted how Obama “seemed to regard . . . Arab-Israel peace as the key to regional stability,” and how he “pledged to engage with Syria and Iran.”

But even Oren was surprised, around the time of Obama’s inauguration, by the assessment of his former Columbia University roommate, David Rothkopf, who had served as undersecretary of commerce, and who told him, “The first thing Obama will do in office is pick a fight with Israel,” a statement that caused Oren to “nearly spill my curry.”

“The previous administration was perceived as too pro-Israel,” said Rothkopf, “and Obama’s policy will be ABB” — Anything But Bush.

Oren spilled nothing, then, when he heard that Obama’s first foreign phone call was reportedly to Palestinian President Mahmoud Abbas, “assuring him of America’s commitment to rebuild war-struck Gaza and pursue peace.”

The disharmony between Obama and Netanyahu began almost immediately. When they met for the first time, Obama “demanded that Netanyahu cease all building not only in the territories but also in the disputed areas of Jerusalem,” reportedly saying to Netanyahu, “Not a single brick. I know how to deal with people who oppose me.”

No matter the issue, Oren portrays Obama and his team as constantly seeking to belittle Netanyahu and Israel, and perceived snubs and insults by the Obama administration are a common thread throughout this book.

Journalist Jeffrey Goldberg, often in touch with senior administration officials, said adjectives they used to describe Netanyahu at various times included “recalcitrant, myopic, reactionary, obtuse, blustering, pompous,” and even, “Aspergery.”

During a time when Palestine sought official UN recognition, Goldberg reported that “unnamed government sources said the White House would ‘oppose [the bid] in spite of Netanyahu, not to help him.’ ”

The president’s dislike of the prime minister,’ Jeff wrote, ‘has deepened in a way that could ultimately be dangerous for Israel. - Ally: My Journey Across the American-Israeli Divide

“‘The president’s dislike of the prime minister,’ Jeff wrote, ‘has deepened in a way that could ultimately be dangerous for Israel,’ ” the book says.

(Oren portrays Goldberg as Obama’s “conduit on all things Israel-related.” During a talk with Goldberg while Netanyahu was en route to Washington, Obama “warned Israel of its growing isolation in the world and vulnerability to boycotts.” Discussing this on Charlie Rose’s program, Goldberg said, “I took it to be a little bit of a veiled threat,” and said he interpreted it as Obama’s way of saying, “nice little Jewish state you got there, I’d hate to see something happen to it.”)

Oren portrays Obama’s contempt for Netanyahu as oozing from every end of his administration. After the massive 2010 earthquake that killed over 150,000 Haitians, Oren writes, Israeli volunteers established the first hospital unit there to assist in the recovery. But when Obama released a statement on the tragedy soon after, he thanked six other countries for their assistance, including Colombia and the Dominican Republic, but snubbed Israel.

“I heard the president’s words,” Oren writes, “and felt like I had been kicked in the chest.”

Secretary of Defense Robert Gates, who had dealings with Netanyahu 20 years prior, “long harbored a visceral dislike” of the Israeli leader, and found himself so offended by what he considered Netanyahu’s “superficiality” and his “glibness . . . his arrogance and outlandish ambition” that he “recommended that he be banned from the White House.”

The relationship between the two administrations evolved far past disagreement to blatant disrespect.

Recalling a heated conversation with National Security Advisor Susan Rice, Oren writes that she told him, “Israel must freeze all settlement activity. Otherwise the United States will not be able to protect Israel from Palestinian actions at the UN.”

When he replied that Israel might prefer an abstention from the United States on the upcoming UN vote, Rice answered, “If you don’t appreciate the fact that we defend you night and day, tell us. We have other important things to do.”

The awkwardness between the camps grew so palpable, it occasionally turned toward the comedic. Secretary of State Condoleezza Rice had often met with Oren’s predecessor, Sallai Meridor, but Oren says he was constantly rebuffed in his efforts to meet with Secretary of State Hillary Clinton, being told that she “did not receive ambassadors.”

But when the two ran into each other at a function, Clinton, “in a testament to her humor, approached me and socked me in the arm, laughing, ‘Michael Oren! I’ve been calling you and calling you but you never return my messages!’ ” (Oren still didn’t get a meeting.)

Of course, the perception of slights went both ways. The two governments hit a crisis in 2010, when Vice President Joe Biden visited Israel. Biden — of whom Oren writes, “a concerted effort is required not to be charmed by [him]” — had been friends with Netanyahu for decades, met with Israeli Prime Minister Golda Meir back in 1973, and often referred to the country as his second home.

While Biden was there, the Israelis announced that they would build 1,600 apartments in an area of Northwest Jerusalem that the Israelis considered their territory, but that the Obama administration considered Palestinian, as it stood on formerly Jordanian land.

The Americans were furious, and many in the Obama administration made their displeasure clear.

Speaking at Tel Aviv University the next day, Biden said that he “condemned” the plan “immediately and unequivocally.” Later that week, Clinton “excoriated Netanyahu for 45 minutes over the phone, rebuking him for humiliating the president and undermining America’s ability to deal with pressing Middle East issues.”

Clinton, in a quote perhaps indicative of the real source of her anger, later said, “I didn’t enjoy playing the bad cop, but it was part of the job.”

Then-Obama Chief of Staff Rahm Emanuel called Oren to inform him that, “America is Israel’s thin blue line. Don’t cross it.” He also called the incident “a pimple on the ass of the US-Israeli friendship.”

Oren grew worried as the conflict seemed to grow worse. David Axelrod, Obama’s senior advisor, told ABC’s Jake Tapper that the settlements were an “insult” and an “affront.” When Tapper asked him “whether he regarded Israel as an asset or a liability, Axelrod simply ducked the question.”

Pulling him aside at that week’s Gridiron Club dinner hoping to defuse the situation, Axelrod “accused me of urging congressmen to hold on until 2012, that Obama would never get reelected.

“The charge of interfering in internal American politics could have rendered me persona non grata and resulted in my expulsion from the United States,” writes Oren, who, due to American law, had to renounce his US citizenship when he accepted the Israeli ambassadorship.

Relations grew even worse in 2012, as Netanyahu was often perceived to be in collusion with the GOP, waiting Obama out so he could begin better relations with a hoped-for President Romney.

When Netanyahu came to New York for the UN General Assembly, Obama refused to meet with him. During the visit, Oren was scheduled to appear on Fox News, but learned he would be appearing on a split-screen with former UN ambassador John Bolton, a “virulent decrier of Obama.” Oren, reasoning he’d be put in the awkward position of having to defend Obama, insisted that he be interviewed alone.

This did not, however, prevent him from being accosted by Bolton as he left the building.

“He physically lunged at me — so fiercely that my security detail stepped in to restrain him,” writes Oren, “and jeered, ‘You’re afraid to go on a split screen! You know what you are? You’re a weenie!’”

There were also perceptions on several occasions that Netanyahu, in his speeches, was trying to command Obama to take certain actions. After one such occurrence at the White House, Emanuel, who Oren notes had a deep affinity for Israel, nevertheless “pump[ed] a half finger into my chest . . . and bark[ed], ‘You do not f–king come to the White House and f–king lecture the president of the United States!’ ”

Oren retired as ambassador in 2013, and earlier this year was elected to the Israeli Knesset.

As horrible as relations were between Obama and Netanyahu throughout his tenure, he writes that they have never been worse than earlier this year, when the Republican-led Congress invited Netanyahu to speak — an invitation he accepted — without informing the president.

There’s no secret about the animosity that this White House has for Prime Minister Netanyahu. - John Boehner

“There’s no secret about the animosity that this White House has for Prime Minister Netanyahu,” said House Speaker John Boehner. “I frankly didn’t want that getting in the way.”

The Obama administration was “enraged,” and “warned that the United States would no longer share intelligence on Iran with Israel and that no one — not the president, the vice president, or even the secretary of state — would receive the prime minister.”

Despite his clear disappointment in the current state of U.S.-Israeli relations, Oren is firm in his belief that the relationship between the two countries is one of the world’s most important alliances, and that everything possible must be done to ensure that the U.S. and Israel remain friends no matter what the disagreements or costs.

“After a half decade of tensions, we must begin the process of repair,” he writes. “American and Israeli leaders must discern their confluent interests and work to realize them. They must revisit the meaning of ‘ally.’”