President Obama faces a knotty decision in whether to approve the much-delayed Keystone oil pipeline: a choice between alienating environmental advocates who overwhelmingly supported his candidacy or causing a deep and perhaps lasting rift with Canada.

Canada, the United States’ most important trading partner and a close ally on Iran and Afghanistan, is counting on the pipeline to propel more growth in its oil patch, a vital engine for its economy. Its leaders have made it clear that an American rejection would be viewed as an unneighborly act and could bring retaliation.

Secretary of State John F. Kerry’s first meeting with a foreign leader was with Canada’s foreign minister, John Baird, on Feb. 8. They discussed the Keystone pipeline project, among other subjects, and Mr. Kerry promised a fair, transparent and prompt decision. He did not indicate what recommendation he would make to the president.

But this is also a decisive moment for the United States environmental movement, which backed Mr. Obama strongly in the last two elections. For groups like the Sierra Club, permitting a pipeline carrying more than 700,000 barrels a day of Canadian crude into the country would be viewed as a betrayal, and as a contradiction of the president’s promises in his second inaugural and State of the Union addresses to make controlling climate change a top priority for his second term.