Hours after New York City released its bid for Amazon’s second headquarters, Mayor Bill de Blasio conveyed an entirely different message to a Brooklyn audience on Wednesday night: The behemoth online retailer is bad for small businesses. Shop local, like he does.

At roughly the same time in the Bronx, the New York Yankees moved one win away from the World Series. But if they make it, they will do so without the usual mayoral boosterism; Mr. de Blasio, an avid Red Sox fan, said he could not bring himself to go to Yankee Stadium.

Mayors in New York and elsewhere have long accepted that a fundamental part of their job is to be a champion for their cities, even if it means putting aside personal preferences in the interest of being a civic ambassador.

Mr. de Blasio is not that mayor.

With re-election appearing to be all but assured next month, the mayor has taken pains to cement the notion that he is very much the same liberal Democrat from Brooklyn who was elected in a landslide four years ago.