For three decades, with barely a blip, the UK capital has been going from strength to strength. Nothing has stunted its potency and growth, not the 7/7 bombings or the 2011 riots, not Black Monday or the 2008 global crash, not even the original Millennium Dome. Its economy drives and subsidises the rest of the country, its still-new tier of regional government – the mayoralty and the Greater London Authority (GLA) – has been a success and it has hosted a triumphant Olympic Games. Its population, after shrinking through years of managed decline, is now at an all-time high, and might hit 10 million by 2030. But London enters 2017 with a question mark after its name. Might its golden age be coming to an end?

After the fireworks, the New Year begins amid unaccustomed unease. The heavy, grey cloud above is Brexit, with major employers in an international city whose wealth has been built on financial services pondering their options for the future. Meanwhile, austerity, albeit moderated by Miliband-ish measures from Theresa May, continues to erode from below. It doesn’t lighten the general mood that armed police officers have become a routine feature of everyday London life. In all these circumstances optimism is essential, but staving off its opposite will require fortitude and skill.

The mayor, of course, has a big part to play in all of this. Sadiq Khan’s 2017 will involve the Labour man in unending nagging of and negotiating with the Conservatives in charge of national government, hoping to secure the best possible post-Brexit deal for the capital and, by extension, the country. His panel of Brexit advisors, bankers, accountants, Peter Mandelson and all, doesn’t delight those who think he’s insufficiently left-wing. But pragmatism is an essential mayoral art: if you want a bunch of Tories to take you seriously, you don’t surround yourself with Corbynites.

Policy delivery will begin with Khan hailing a freeze on those public transport fares that Transport for London (TfL) sets, but not the universal one some of his election campaign statements and a line in his manifesto claimed. Political opponents will attack him (again) for that, and for the demands he is making on TfL’s finances as a whole as his first mayoral budget, covering all GLA functions, comes under closer public scrutiny.

Khan’s new “hopper” fare, which enables bus passengers to catch two buses for the price of one during a 60 minute period, has given him - not to mention a lot of Londoners on low incomes - a quick early win. But this initiative, though welcome, needs to be seen in the context of falling bus ridership, something TfL can ill afford given its increasing dependence on fares revenue.

This, in turn, is a consequence of worsening road traffic congestion, which London’s economy could do without. Congestion also harms air quality, another issue the mayor has sought to make a fast start on. He is set to kick-off implementing his anti-pollution policies by introducing an emissions surcharge (the so-called “T-charge” on toxicity) on high-pollution vehicles entering the congestion charge zone early in 2017, but will be urged by critical friends to go further with his policies as a whole.

Holding down public transport fares is one part of a broader attempt to address London’s high cost of living, which leaves too many of its households, including around 40% of its children, struggling to make ends meet on unacceptably low pay and excluded from many of the city’s riches. Housing costs are, famously, a huge factor in this and also hugely difficult to control. The mayor’s housing team has assembled a purposeful strategy for getting more homes built for sale, rent or a combination of both at prices ordinary Londoners can afford. Khan will hope to be able to boast of initial successes as he embarks on the vast task of trying to better match housing delivery to the city’s social and economic need. The backdrop to all this is the ongoing three-year monster mission of writing a new London Plan.

There are going to be tensions. Hammered by successive grant cuts and hampered by limits on their freedom to borrow to build, some of the capital’s boroughs, often Labour-run, are becoming ever more adroit at finding ways to meet at least some local “affordable” housing demand, but these can mean private sector partnerships involving publicly owned land that don’t always work as well as planned. The available alternatives - largely, small variations on doing nothing - aren’t all that attractive either.

Squeezed between the same rock and hard place we find shortages of school places and health and social care provision also having their impact at borough, and indeed neighbourhood level. Dynamic boroughs and the mayor alike are trying to get more more purchase on low-cost childcare and improving post-school skills training, as the city strives for greater autonomy in the running of its affairs.

A striking thing about the politics of London is the high degree of consensus about the benefits of devolving power over such things as welfare programmes, property taxes and infrastructure investment from Whitehall. Agreement crosses party lines and unifies business interests, social sector campaigners and more. There is strength in that solidarity. London will need every ounce of it to keep on prospering in 2017 and beyond.